System.Win.ScktComp.TServerWinSocket.Accept

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Accept(Socket: TSocket); override;

C++

virtual void __fastcall Accept(NativeInt Socket);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Win.ScktComp.pas
System.Win.ScktComp.hpp
System.Win.ScktComp TServerWinSocket

Description

Accepts a connection to a client 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.

See Also