mxmbsocket/src/Ratchet/Server/IoConnection.php
Grégoire Pineau 3a8578bd17 CS (eof_ending)
2014-03-21 16:46:43 +01:00

39 lines
675 B
PHP

<?php
namespace Ratchet\Server;
use Ratchet\ConnectionInterface;
use React\Socket\ConnectionInterface as ReactConn;
/**
* {@inheritdoc}
*/
class IoConnection implements ConnectionInterface {
/**
* @var \React\Socket\ConnectionInterface
*/
protected $conn;
/**
* @param \React\Socket\ConnectionInterface $conn
*/
public function __construct(ReactConn $conn) {
$this->conn = $conn;
}
/**
* {@inheritdoc}
*/
public function send($data) {
$this->conn->write($data);
return $this;
}
/**
* {@inheritdoc}
*/
public function close() {
$this->conn->end();
}
}