soConfigNonblock (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.08.00


The soConfigNonblock function configure the non-blocking state of a socket.

 

When a socket is marked as blocking, the socket functions will block and wait until their function is completed.

For example the soConnect function will block until the socket connection is established.

 

When a socket is marked as non-blocking, the socket functions will return immediately with error -4 (would block) instead of blocking.

It is then up to the application to determine when the function is ready to complete.

(In case of the example above, by calling the soStatus function to determine when the socket is connected)

 

 

Input:

socket : SYSHANDLE

Handle to the socket.

 

enable : BOOL

Set TRUE to make the socket non-blocking and FALSE to make the socket blocking.

 

 

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.

-17

- Generic error.

 

 

Declaration:

FUNCTION soConfigNonblock : INT;
VAR_INPUT
  socket : SYSHANDLE;
  enable : BOOL;
END_VAR;

 

 


Example:

 

Please see the "Examples - Web client"