vxWorks Socket非阻塞(查询)模式数据接收recvform()小析
(2012-06-12 22:05:05)
标签:
杂谈 |
Sockets respond to the following ioctl(
) functions. These functions are defined in the header files ioLib.h and ioctl.h.
- FIONBIO
- Turns on/off non-blocking I/O.
on = TRUE; status = ioctl (sFd, FIONBIO, &on);- FIONREAD
- Reports the number of read-ready bytes available on the socket. On the return of ioctl(
) , bytesAvailable has the number of bytes available to read from the socket.status = ioctl (sFd, FIONREAD, &bytesAvailable);- SIOCATMARK
- Reports whether there is out-of-band data to be read from the socket. On the return of ioctl(
) , atMark is TRUE (1) if there is out-of-band data. Otherwise, it is FALSE (0).status = ioctl (sFd, SIOCATMARK, &atMark);To use this feature, include the following component: INCLUDE_BSD_SOCKET