Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Winsock define missing?

Paul_Curtis
Valued Contributor I
479 Views
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
0 Kudos
2 Replies
Steven_L_Intel1
Employee
479 Views
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.
0 Kudos
Paul_Curtis
Valued Contributor I
479 Views
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.
0 Kudos
Reply