OnConnect Event  

The client has established a connection to the server.


Sub object_OnConnect ( [Index As Integer,] ByVal ClientId As Variant, ByVal ClientAddress As Variant )


An integer value which uniquely identifies the client session.
A string that specifies the IP address of the client. This address may either be in IPv4 or IPv6 format, depending on how the server was configured and the address the client used to establish the connection.


The OnConnect event occurs after the client has established its initial connection to the server, after the server has checked the active client limits and the TLS handshake has been performed if required. If the server has been suspended, or the limit on the maximum number of client sessions has been exceeded, the server will terminate the client session prior to this event handler being invoked.

If no event handler is implemented, the server will perform the default action of accepting the connection and waiting for the client to send its request. To reject a connection, call the SendError method to send an error response to the client. If you do not wish to send an error response, you may simply call the Disconnect method to terminate the session.

See Also

OnCommand Event, OnDisconnect Event