\PHP\WebSocketSocketListener

Socket server listener interface.

Implement this to communicate with the socket server.

Summary

Methods
Constants
onMessageRecieved()
onClientConnected()
onClientDisconnected()
onLogMessage()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

onMessageRecieved()

onMessageRecieved(\PHP\WebSocket\SocketServer  $server, \PHP\WebSocket\SocketClient  $sender, string  $message) 

Called when a client sends a message to the server.

Parameters

\PHP\WebSocket\SocketServer $server

The server instance

\PHP\WebSocket\SocketClient $sender
string $message

Sent message

onClientConnected()

onClientConnected(\PHP\WebSocket\SocketServer  $server, \PHP\WebSocket\SocketClient  $client) 

Called when a new client connects to the server.

Parameters

\PHP\WebSocket\SocketServer $server

The server instance

\PHP\WebSocket\SocketClient $client

Client that connected

onClientDisconnected()

onClientDisconnected(\PHP\WebSocket\SocketServer  $server, \PHP\WebSocket\SocketClient  $client) 

Called when a client disconnects from the server.

Parameters

\PHP\WebSocket\SocketServer $server

The server instance

\PHP\WebSocket\SocketClient $client

Client that disconnected

onLogMessage()

onLogMessage(\PHP\WebSocket\SocketServer  $server, string  $message) 

Called when the server generates a log message.

Parameters

\PHP\WebSocket\SocketServer $server

The server

string $message

Log message