Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
41 lines
719 B
PHP
41 lines
719 B
PHP
<?php
|
|
namespace mfmdevsystem\socket\Server;
|
|
use mfmdevsystem\socket\ConnectionInterface;
|
|
use React\Socket\ConnectionInterface as ReactConn;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
class IoConnection implements ConnectionInterface {
|
|
/**
|
|
* @var \React\Socket\ConnectionInterface
|
|
*/
|
|
protected $conn;
|
|
|
|
public $decor;
|
|
|
|
|
|
/**
|
|
* @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();
|
|
}
|
|
}
|