mxmbsocket/lib/Ratchet/Command/Action/CloseConnection.php
Chris Boden 1d14119bb5 Command Refactoring
Refactored Command namespace; reusing more code, standardized interfaces
WebSocket handles wrapping messages better/properly now
2011-11-08 09:32:20 -05:00

16 lines
396 B
PHP

<?php
namespace Ratchet\Command\Action;
use Ratchet\Command\ActionTemplate;
use Ratchet\SocketObserver;
/**
* Close the connection to the sockets passed in the constructor
*/
class CloseConnection extends ActionTemplate {
function execute(SocketObserver $scope = null) {
$ret = $scope->onClose($this->getSocket());
$this->getSocket()->close();
return $ret;
}
}