[Overview][Constants][Types][Procedures and functions][Variables] Reference for unit 'Sockets' (#rtl)

Listen

Listen for connections on socket.

Declaration

Source position: socketsh.inc line 182

function Listen(

  Sock: LongInt;

  MaxConnect: LongInt

):Boolean;

Description

Listenlistens for up to MaxConnectconnections from socket Sock. The socket Sockmust be of type SOCK_STREAMor Sock_SEQPACKET.

The function returns Trueif a connection was accepted, Falseif an error occurred.

Errors

Errors are reported in SocketError, and include the following:

SYS_EBADF
The socket descriptor is invalid.
SYS_ENOTSOCK
The descriptor is not a socket.
SYS_EOPNOTSUPP
The socket type doesn't support the Listenoperation.

See also

Socket

  

Create new socket

Bind

  

Bind a socket to an address.

Connect

  

Open a connection to a server socket.