www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - 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 or 237, when the connection was not completed.   The user can repeat this API call in a periodic loop until a successful connection is established. In this case the connect function returns error code 0 or 256 (socket is already connected).

See Also

RTOS API

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

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    V1.00V1.00V1.00V0.90

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


End of document