soAccept (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


The soAccept function will accept the first pending connection attempt, if present, in the queue of a listening socket.

A new socket will be created for the resulting connection.

 

On a blocking socket, the function will wait until an incoming connection attempt is received before returning.

With a non-blocking socket, the function will return immediately if no pending connection attempts are present. In this case soAccept will return -4.

 

The socket must be marked as listening for incoming connections with the soListen function before calling this function.

 

 

Input:

socket : SYSHANDLE

Handle to the socket.

 

Output:

remote : SYSHANDLE

Handle to the new socket.

 

 

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.

-4

- The socket is marked non-blocking and the operation would block.

-9

- The connection attempt was aborted.

-11

- Memory error.

-15

- It is not possible to open a new socket.

-17

- Generic error.

-101

- The certificate can not be validated.

-102

- The certificate is expired or not yet valid.

-103

- The root certificate cannot be validated.

-104

- The client did not send a certificate.

-105

- The TLS handshake failed.

 

 

Declaration:

FUNCTION soAccept : INT;
VAR_INPUT
  socket : SYSHANDLE;
  remote : ACCESS SYSHANDLE;
END_VAR;

 

 


Example:

 

Please see the "Examples - Telnet server2"