PHP Интерфейс Kraken\Network\NetworkComponentInterface

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
handleConnect ( Kraken\Network\NetworkConnectionInterface $conn ) When a new connection is opened it will be passed to this method.
handleDisconnect ( Kraken\Network\NetworkConnectionInterface $conn ) This is called before or after a socket is closed
handleError ( Kraken\Network\NetworkConnectionInterface $conn, Erro\Error | Exceptio\Exception $ex ) If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown, the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method.
handleMessage ( Kraken\Network\NetworkConnectionInterface $conn, Kraken\Network\NetworkMessageInterface $message ) Triggered when a client sends data through the socket.

Описание методов

handleConnect() публичный Метод

When a new connection is opened it will be passed to this method.
public handleConnect ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface

handleDisconnect() публичный Метод

This is called before or after a socket is closed
public handleDisconnect ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface The socket/connection that is closing/closed

handleError() публичный Метод

If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown, the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method.
public handleError ( Kraken\Network\NetworkConnectionInterface $conn, Erro\Error | Exceptio\Exception $ex )
$conn Kraken\Network\NetworkConnectionInterface
$ex Erro\Error | Exceptio\Exception

handleMessage() публичный Метод

Triggered when a client sends data through the socket.
public handleMessage ( Kraken\Network\NetworkConnectionInterface $conn, Kraken\Network\NetworkMessageInterface $message )
$conn Kraken\Network\NetworkConnectionInterface
$message Kraken\Network\NetworkMessageInterface