is there any api that let me know the messages associated with a socket ( like FD_READ ,FD_WRITE ..etc)

i need the inverse of WSAAsyncSelect :)

thanks in advance
Posted on 2003-08-05 08:43:56 by Sa6ry
as far as I know, there's only the following:
FD_READ
FD_WRITE
FD_ACCEPT
FD_CONNECT
FD_CLOSE
FD_OOB

Your call tells winsock which ones you care to receive.
The values are predefined, and all socket apps should receive messages which contain one OR MORE of these values.
Under some of the more complex socket models, it's normal to be getting more than one of the above, OR'd together.
Example would be FD_READ | FD_CLOSE
which indicates that the session has ended, but data remains in the recv buffer.

Was that useful?
Posted on 2003-08-06 00:25:27 by Homer
thanks for helping , this wasn't what i was looking for :(

but after some searching in MSDN i found something close to what i was searching for.

the API ioctlsocket ( it could be used to know if the socket is blocking or not )

========================================
FIONBIO
Use with a nonzero argp parameter to enable the nonblocking mode of socket s. The argp parameter is zero if nonblocking is to be disabled. The argp parameter points to an unsigned long value. When a socket is created, it operates in blocking mode by default (nonblocking mode is disabled). This is consistent with BSD sockets.
The WSAAsyncSelect and WSAEventSelect functions automatically set a socket to nonblocking mode. If WSAAsyncSelect or WSAEventSelect has been issued on a socket, then any attempt to use ioctlsocket to set the socket back to blocking mode will fail with WSAEINVAL.

To set the socket back to blocking mode, an application must first disable WSAAsyncSelect by calling WSAAsyncSelect with the lEvent parameter equal to zero, or disable WSAEventSelect by calling WSAEventSelect with the lNetworkEvents parameter equal to zero.
========================================

but still don't know a way to know the message that was prev. selected using select
i know this sounds stupied ( as assumed i know this informatin )

but the application i am working in , i don't know this information !!

thanks alot for your help.
Posted on 2003-08-06 07:03:07 by Sa6ry