Files
expose/app/WebSockets/Socket.php
Marcel Pociot 2b03398f40 wip
2020-04-14 21:19:23 +02:00

30 lines
629 B
PHP

<?php
namespace App\WebSockets;
use Ratchet\ConnectionInterface;
use Ratchet\RFC6455\Messaging\MessageInterface;
use Ratchet\WebSocket\MessageComponentInterface;
class Socket implements MessageComponentInterface
{
public static $connections = [];
public function onOpen(ConnectionInterface $connection)
{
self::$connections[] = $connection;
}
public function onMessage(ConnectionInterface $from, MessageInterface $msg)
{
}
public function onClose(ConnectionInterface $connection)
{
}
public function onError(ConnectionInterface $connection, \Exception $e)
{
}
}