- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am making a set of F90Winsock wrapper routines.
In attempting to invokeioctlsocket()to find the number of pending bytes received by a socket, the call does not compile, with the message that the integer parameter (command-type argument)FIONREAD is undefined.
Even though this parameter seems to be definedinIFWINTY, it is not found by the compiler when IFWINTY is INCLUDEd.
Any help with fixing IFWINTY and/or a working definition of FIONREAD would be appreciated. For that matter, a search of this forum, comp.lang.fortran and google turned up nothing on F90 Winsock wrappers, but if (likely) someone has already done this, a peek at a working set of wrappers would also be greatly appreciated.
TIA, Paul Curtis
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting - the define in IFWINTY is commented out because the expression in winsock2.h was just a bit too complex...
integer, parameter :: FIONREAD = Z'4004667f'
integer, parameter :: FIOASYNC = Z'8004667d'
integer, parameter :: SIOCSHIWAT = Z'80047300'
integer, parameter :: SIOCGHIWAT = Z'40047301'
integer, parameter :: SIOCSLOWAT = Z'80047302'
integer, parameter :: SIOCGLOWAT = Z'40047303'
integer, parameter :: SIOCATMARK = Z'40047307'
will do it.
integer, parameter :: FIONREAD = Z'4004667f'
integer, parameter :: FIOASYNC = Z'8004667d'
integer, parameter :: SIOCSHIWAT = Z'80047300'
integer, parameter :: SIOCGHIWAT = Z'40047301'
integer, parameter :: SIOCSLOWAT = Z'80047302'
integer, parameter :: SIOCGLOWAT = Z'40047303'
integer, parameter :: SIOCATMARK = Z'40047307'
will do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, here is a link to a functional definition of this command argument:
which I think renders in fortran as
FIONREAD = LSHIFT(4,28) + LSHIFT(4,16) + LSHIFT(ICHAR("f"),8) + 127
but I'll use your supplied constants instead. Thanks.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page