_TCPServer_OnConnect
Previous Top Next

TCPServer_OnConnect ( string $sFunction )

Sets a callback function for the OnConnect event.

This event is fired every time a client connects.

$sFunction function will receive two parameters:
·     The first parameter is the socket ID for the new client
·     The second parameter is the IP address of the new 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.