RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TServerWinSocket.Accept Method

Accepts a connection to a client socket.

Pascal
procedure Accept(Socket: TSocket); override;
C++
virtual __fastcall Accept(TSocket Socket);

Accept is called automatically in response to notifications that a client socket is requesting a connection. The Socket parameter is the Windows socket handle for the listening connection. 

Accept accepts the client connection request, obtaining the Windows socket handle for the client connection. It then generates an OnGetSocket event, passing this socket handle as an argument to any event handler. If a TServerClientWinSocket is not created by an OnGetSocket event handler, Accept creates a TServerClientWinSocket to represent the server endpoint of the accepted connection. Next, Accept obtains a running TServerClientThread, either by restarting a thread in the cache, obtaining one from an OnGetThread event, or creating a new TServerClientThread object. This new thread handles the connection to the client socket. 

Accept is only called if the ASyncStyles property includes asAccept. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!