mxmbsocket/lib/Ratchet/SocketObserver.php
Chris Boden c45962c7b4 Done todo's
Removed a bunch of @todo annotations that have been completed
2011-11-08 08:51:53 -05:00

30 lines
898 B
PHP

<?php
namespace Ratchet;
/**
* Observable/Observer design pattern interface for handing events on a socket
*/
interface SocketObserver {
/**
* When a new connection is opened it will be passed to this method
* @param SocketInterface
* @return Command\CommandInterface|NULL
*/
function onOpen(SocketInterface $conn);
/**
* Triggered when a client sends data through the socket
* @param SocketInterface
* @param string
* @return Command\CommandInterface|NULL
*/
function onRecv(SocketInterface $from, $msg);
/**
* This is called just before the connection is closed
* @param SocketInterface
* @return Command\CommandInterface|NULL
* @todo This is triggered if the client or server terminates the connection; consider a new onDisconnect if server triggered
*/
function onClose(SocketInterface $conn);
}