mxmbsocket/lib/Ratchet/Command/CloseConnection.php
2011-10-28 15:15:23 -04:00

23 lines
483 B
PHP

<?php
namespace Ratchet\Command;
use Ratchet\SocketCollection;
/**
* Close the connection to the sockets passed in the constructor
*/
class CloseConnection implements CommandInterface {
/**
* @var SocketCollection
*/
protected $_sockets;
public function __construct(SocketCollection $sockets) {
$this->_sockets = $sockets;
}
function execute() {
foreach ($this->_sockets as $socket) {
$socket->close();
}
}
}