Base | --ServerSocket
Located in File: Program_Root/sdk/socket/ServerSocket.php
Provides a simple Socket object for use when listening on sockets.
Magnus Rosenquist, Zyneo
Class Variable Summary |
$__host
Host to connect to Default Value:
|
$__listener
Listener object for callbacks Default Value:
|
$__port
Port to connect to Default Value:
|
$__socket
The listening socket Default Value:
|
Inherited Class Variable Summary | |||||||||||||||||||||
Inherited From Class Base
|
Method Summary |
void constructor ServerSocket ( $host, $port )
Creates a new ServerSocket for use with specified host and port |
void addMessageListener ( $listener )
Adds the listener which is called when requests are received. |
void listen ( )
Listens on specified host and port for incoming requests from gateway. |
void send ( $msg )
Sends a message back to the gateway using the connected socket. |
Inherited Method Summary |
Inherited From Class Base
|
Method Detail |
void ServerSocket( string $host, int $port)
Creates a new ServerSocket for use with specified host and port- string $host:
- int $port:
[ Top ]
void addMessageListener( object $listener)
Adds the listener which is called when requests are received.This is only used in GatewayListener.
- object $listener: the object listening for requests.
adapter.GatewaySender
[ Top ]
void listen( )
Listens on specified host and port for incoming requests from gateway.Calls callback-method 'onMessageReceive' on the listener object when message from socket is read.
ServerSocket::$__listener
[ Top ]
void send( string $msg)
Sends a message back to the gateway using the connected socket.- string $msg: message to send.
[ Top ]
Variable Detail |
[ Top ]
[ Top ]
[ Top ]
[ Top ]