System.Win.ScktComp.TCustomWinSocket.Listen
Delphi
procedure Listen(const Name, Address, Service: string; Port: Word;
QueueSize: Integer; Block: Boolean = True);
C++
void __fastcall Listen(const System::UnicodeString Name, const System::UnicodeString Address, const System::UnicodeString Service, System::Word Port, int QueueSize, bool Block = true);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Win.ScktComp.pas System.Win.ScktComp.hpp |
System.Win.ScktComp | TCustomWinSocket |
Description
Opens a listening connection for a server socket.
Server socket components call Listen to open a listening connection.
Listen creates the Windows socket that will make the listening connection, and binds the Windows Internet socket address derived from the parameters to the socket. Listen then generates an OnSocketEvent of type seListen. Finally, Listen opens the socket as a listening connection with a queue that can hold QueueSize client requests, setting the Connected property to true.
The Name, Address, Service, and Port parameters are taken from the Host, Address, Service and Port properties of the server socket component.
QueueSize indicates how many client requests the listening connection can hold. TServerSocket sets the QueueSize to 5.
Block indicates whether the socket can look up the information it needs to establish a connection asynchronously. When Block is true, the socket blocks execution for each lookup instead of retrieving information about the connection using asynchronous notifications.