Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php
2
namespace Ratchet\Server;
3
use Ratchet\ConnectionInterface;
4
use React\Socket\ConnectionInterface as ReactConn;
5
 
6
/**
7
 * {@inheritdoc}
8
 */
9
class IoConnection implements ConnectionInterface {
10
    /**
11
     * @var \React\Socket\ConnectionInterface
12
     */
13
    protected $conn;
14
 
15
 
16
    /**
17
     * @param \React\Socket\ConnectionInterface $conn
18
     */
19
    public function __construct(ReactConn $conn) {
20
        $this->conn = $conn;
21
    }
22
 
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function send($data) {
27
        $this->conn->write($data);
28
 
29
        return $this;
30
    }
31
 
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function close() {
36
        $this->conn->end();
37
    }
38
}