mxmbsocket/lib/Ratchet/SocketObserver.php
Chris Boden 7c5c5ed6ce Standardized Interfaces
Allowed null to be returned instead of NullCommand on Observers
Removed profanity
2011-11-01 11:44:28 -04:00

29 lines
768 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
*/
function onClose(SocketInterface $conn);
}