RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TServerWinSocket.Listen Method

Opens a listening connection for a server socket.

Pascal
procedure Listen(var Name: string; var Address: string; var Service: string; Port: Word; QueueSize: Integer);
C++
__fastcall Listen(AnsiString Name, AnsiString Address, AnsiString Service, Word Port, int QueueSize);

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. The QueueSize is set to 5 by TServerSocket

 

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