2018-11-20 10:32:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace BeyondCode\LaravelWebSockets;
|
|
|
|
|
|
2018-11-21 23:25:24 +00:00
|
|
|
use Exception;
|
2018-11-20 10:32:56 +00:00
|
|
|
use Ratchet\ConnectionInterface;
|
|
|
|
|
use Ratchet\RFC6455\Messaging\MessageInterface;
|
|
|
|
|
use Ratchet\WebSocket\MessageComponentInterface;
|
|
|
|
|
|
|
|
|
|
class WebSocketController implements MessageComponentInterface
|
|
|
|
|
{
|
2018-11-21 23:25:24 +00:00
|
|
|
function onOpen(ConnectionInterface $connection)
|
2018-11-20 10:32:56 +00:00
|
|
|
{
|
2018-11-21 11:13:40 +00:00
|
|
|
dump("Client connected");
|
2018-11-20 10:32:56 +00:00
|
|
|
}
|
|
|
|
|
|
2018-11-21 23:25:24 +00:00
|
|
|
public function onMessage(ConnectionInterface $connection, MessageInterface $message)
|
2018-11-20 10:32:56 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-21 23:25:24 +00:00
|
|
|
|
|
|
|
|
function onClose(ConnectionInterface $connection)
|
2018-11-20 10:32:56 +00:00
|
|
|
{
|
|
|
|
|
}
|
2018-11-21 23:25:24 +00:00
|
|
|
|
|
|
|
|
function onError(ConnectionInterface $connection, Exception $exception)
|
2018-11-20 10:32:56 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|