_TCPServer_OnDisconnect
Previous Top Next

TCPServer_OnDisconnect ( string $sFunction )

Sets a callback function for the OnDisconnect event.

This event is fired every time a client disconnects.

$sFunction function will receive two parameters:
·     The first parameter is the closed socket ID
·     The second parameter is the IP address of the disconnected client

 You must retreive all the 2 parameters on your function, even if you're not going to use one or more of them. Like this:

Func MyCallbackFunc($iSocket, $sIP)

EndFunc

It's worth to remember that setting up events is not mandatory.