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\MessageComponentInterface;
4
use Ratchet\ConnectionInterface;
5
 
6
/**
7
 * A simple Ratchet application that will reply to all messages with the message it received
8
 */
9
class EchoServer implements MessageComponentInterface {
10
    public function onOpen(ConnectionInterface $conn) {
11
    }
12
 
13
    public function onMessage(ConnectionInterface $from, $msg) {
14
        $from->send($msg);
15
    }
16
 
17
    public function onClose(ConnectionInterface $conn) {
18
    }
19
 
20
    public function onError(ConnectionInterface $conn, \Exception $e) {
21
        $conn->close();
22
    }
23
}