mxmbsocket/lib/Ratchet/Command/Action/CloseConnection.php
Chris Boden c45962c7b4 Done todo's
Removed a bunch of @todo annotations that have been completed
2011-11-08 08:51:53 -05:00

26 lines
591 B
PHP

<?php
namespace Ratchet\Command\Action;
use Ratchet\Command\ActionInterface;
use Ratchet\SocketInterface;
use Ratchet\SocketObserver;
/**
* Close the connection to the sockets passed in the constructor
*/
class CloseConnection implements ActionInterface {
/**
* @var SocketInterface
*/
protected $_socket;
public function __construct(SocketInterface $socket) {
$this->_socket = $socket;
}
function execute(SocketObserver $scope = null) {
$ret = $scope->onClose($this->_socket);
$this->_socket->close();
return $ret;
}
}