With Intel Fortran, the various sockets functions in wsock32 that read/write data take the data in as a character buffer, CHARACTER*(), equivalent to char. The same functions in the PGI Fortran declare that buffer at INTEGER(HANDLE).
So the question is - How do I use these functions and pass in the character buffer data? Is there some way to get the pointer to the character buffer and cast it as INTEGER(HANDLE)? Or some other trick?
Thanks,
Andy Elliott
Here is the INTERFACE block from wsock32.f90 for the send function from Intel:
FUNCTION send( s, buf, len, flags)
use ifwinty
integer(SINT) :: send ! int
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'send' :: send
integer(UINT_PTR) s ! SOCKET s
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: buf
character*(*) buf ! char* buf
integer(SINT) len ! int len
integer(SINT) flags ! int flags
END FUNCTION
And here is the same function from PGI:
FUNCTION send( s, buf, len, flags)
USE DFWINTY
integer(SINT) :: send ! int
!DEC$ ATTRIBUTES STDCALL, DECORATE, ALIAS : 'send' :: send
integer(UINT_PTR) s ! SOCKET s
integer(HANDLE) buf ! char buf
integer(SINT) len ! int len
integer(SINT) flags ! int flags
END FUNCTION