Allows the application to query the status of multiple sockets. If timeout is null, vm_soc_select() will wait indefinitely until the first socket is ready. If both tv_sec and tv_msec are zero, vm_soc_select() will timeout immediately for polling the sockets in the set. in:
out:
ex: If processing a connect request (non-blocking mode), connection attempt failed. OOB data is available for reading (only if VM_SOC_OOBINLINE is disabled). Useful Macros: FD_ZERO(fd_set) Reset fd_set. FD_SET(s, fd_set) Add a particular socket with ID of s to fd_set. FD_CLR(s, fd_set) Remove a particular socket with ID of s from fd_set. FD_ISSET(s, fd_set) Non-zero if s is a member of the fd_set (s is ready). Otherwise, zero.
|
Parameters |
Description |
|
int nfds |
[IN] The highest-numbered socket descriptor in any of the three sets, plus 1. |
|
fd_set* readfds |
[IN] Set of socket descriptors for read. |
|
fd_set* writefds |
[IN] Set of socket descriptors for write. |
|
fd_set* exceptfds |
[IN] Set of socket descriptors for exceptions. |
|
const timeval* timeout |
|
Return Values |
Description |
|
Non-negative number |
The number of ready sockets. |
|
Zero |
The timeout expires before anything interesting happens. |
|
VM_SOC_INVALID_SOCKET |
Invalid socket ID. |
|
VM_SOC_INVAL |
Socket is not calling soc_listen. |
|
VM_SOC_WOULDBLOCK |
Non-blocking. |
|
VM_SOC_BEARER_FAIL |
Bearer broken. |
|
VM_SOC_ERROR |
Unspecified error. |
timeval timeout; fd_set writefds; timeout.tv_sec = 0; timeout.tv_usec = 2000; FD_ZERO(&writefds); FD_SET((bf_u32)sockIds[sock].id, &writefds); if (vm_soc_select(sockIds[sock].id+1, 0, &writefds, 0, &timeout) >= 0) { if (FD_ISSET(sockIds[sock].id, &writefds)) { //socket is ready for writting data } }
vmsock.h
Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at
support@toolsfactory.com.