www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


select_ms

Poll, await up to a maximum number of milliseconds, or wait forver for specified events on a selected set of sockets. .

int select_ms ( int         nfds,
                fd_set far *readfds,
                fd_set far *writefds,
                fd_set far *exceptfds,
                long        timeout ) ;

Parameters

nfds

One greater than highest socket descriptor to be monitored in the following set of three fd_set objects.

readfds

Input/Output Parameter:   Pointer to a fd_set bit field that on input specifies the set of sockets to be monitored for receiver activity.   On return those sockets for which receiver data is ready among those specified for monitoring will have their bits in this field set to '1'.   All other bits will be zeroed.

writefds

Input/Output Parameter:   Pointer to a fd_set bit field that on input specifies the set of sockets to be monitored for send ready condition.   On return those sockets ready for send among those specified for monitoring here will have their bits in this field set to '1'.   All other bits will be zeroed.

exceptfds

Input/Output Parameter:   Pointer to a fd_set bit field that on input specifies the set of sockets to be monitored for error conditions.   On return those sockets with errors among those specified for monitoring here will have their bits in this field set to '1'.   All other bits will be zeroed.

timeout

Timeout in milliseconds.   Set to a minus value to block without timeout.   Set to zero for polling.

Return Value

0 if timeout, otherwise number of hits.   This is the number of selected sockets for which a specified event has occurred.

If nfds input parameter was invalid, then the return value will also be zero.

Comments

This alternative to select() API is available for when Berkeley sockets compatible source is not required.   The only difference is that this function takes the timeout value as a simple long value in units of milliseconds.   And a zero value for the timeout argument allows for polling.

Refer to the select() API description for more information about these API.

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

    SC12SC13SC11SC1x3SC2x
    V1.22V1.22V1.22V1.11V1.00

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.08

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


End of document