CInternetServer::OnConnect Method  
 
virtual void OnConnect(
  SOCKET hSocket,  
  UINT nClientId,  
  LPCTSTR lpszAddress,  
  UINT nPort  
);

A virtual method that is invoked after the client has connected to the server.

Parameters

hSocket
A handle to the client socket.
nClientId
An unsigned integer which uniquely identifies the client session.
lpszAddress
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.
nPort
An integer that specifies the port number that the client socket is bound to.

Return Value

None.

Remarks

The OnConnect event handler is invoked after the client has connected to the server. To implement an event handler, the application should create a class derived from the CInternetServer class, and then override this method.

This event only occurs after the server has checked the active client limits and the TLS handshake has been performed, if security has been enabled. If the server has been suspended, or the limit on the maximum number of client sessions has been exceeded, the server will reject the connection prior to this event handler being invoked.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cswsock10.h
Import Library: cswskv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

Disconnect, OnAccept, OnDisconnect