www.beck-ipc.com

@CHIP-RTOS C Library V2.00 - TCP/IP API


Set_Blocking_Mode

Set a socket in blocking or non-blocking mode.

int Set_Blocking_Mode ( int sd, unsigned char blocking_mode,
                        int *error );

Parameters

sd

Socket descriptor.

blocking_mode

0: switch blocking off, 1:switch blocking on.

error

Output parameter:  Failure code, 0 on success.

Return Value

0 = success
Non-zero = Failure (see error output parameter)

Comments

By default all sockets are in blocking mode.   If a socket is set to non blocking mode, socket calls such as connect and accept do not wait until full completion.  Instead they return immediately.

Example usage of non-blocking mode:
    The connect call returns at a non blocking socket with error code 236, when the connection was not completed.   The user can repeat this API call in a periodic loop until a successful connection is established.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.


This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document