soListen (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


The soListen function marks the socket as listening for incoming connection attempts.

Any incoming connection attempts will be queued pending acceptance by the soAccept function. If the queue is full, subsequent connection attempts will be refused.

 

The socket must be bound to a local address with the soBind function before calling this function.

 

 

Input:

socket : SYSHANDLE

Handle to the socket.

 

backlog : INT (default 1)

The maximum number of pending connections allowed.

 

 

Returns: INT

1

- Success.

0

- The function is not supported.

-1

- The handle is not a valid socket.

-2

- One or more parameters are illegal.

-3

- The socket is closed.

-5

- The socket does not support this action.

-8

- The local address is already used by another socket.

-17

- Generic error.

 

 

Declaration:

FUNCTION soListen : INT;
VAR_INPUT
  socket  : SYSHANDLE;
  backlog : INT := 1;
END_VAR;

 

 


Example:

 

Please see the "Examples - Telnet server2"