The OnAccept event handler is invoked when a client attempts
to connect to the server, but prior to the connection being accepted. 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 before the server has checked the active
client limits. This event is typically used to reject a connection
based on some criteria established by the server, such as the IP
address of the client attempting to make the connection. To obtain the
IP address of the client that is attempting to connect to the server,
use the GetClientAddress method using the server handle.
If this event handler is not implemented, the server will permit
the client connection to complete. To reject the connection attempt, call the
Reject method using the handle to the server socket.
Rejecting the client connection within the OnAccept event
handler may cause unexpected behavior by the client application
because the connection process will not complete normally. Instead of
rejecting the client connection within the OnAccept handler, it
is recommended that most server applications implement an OnConnect
event handler, perform any required checks and then gracefully
disconnect the client using the Disconnect method if needed.