I have a few questions on the winsock wrapper code.
1. In the win32sock.c, there is a function called set_socktype(). This function, calls setsockopt() if the USE_SOCKETS_AS_HANDLES is defined. Is there a reason why the code calls sets the SO_OPENTYPE for all successive sockets??
2. Is there any downside in calling this routine only when a socket is created and calling it only for that specific socket? Note that the setsockopt() call below is using INVALID_SOCKET as the input option and so it affects all successive socket calls.
3. We are running into some issues because we have another code (closed source -- so no way to muck with that code) that relies on the sockets being asynchronous. By setting SO_OPENTYPE to a non-zero value, for all sockets, we cannot call completion functions anymore.
4. What are the ramifications by disbaling this setsockopt() call?
Any help or work-arounds that users can think-of, is greatly appreciated.
Thanks,
Vasu
Note: I have tried this with both Perl 5.8.0 and 5.8.4 and see the same behavior.
******** CODE FOR set_socktype() FUNCTION IN WIN32SCK.c ********
void
set_socktype(void)
{
#ifdef USE_SOCKETS_AS_HANDLES
#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
dTHX;
if (!w32_init_socktype) {
#endif
int iSockOpt = SO_SYNCHRONOUS_NONALERT;
/*
* Enable the use of sockets as filehandles
*/
setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
(char *)&iSockOpt, sizeof(iSockOpt));
#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
w32_init_socktype = 1;
}
#endif
#endif /* USE_SOCKETS_AS_HANDLES */
}
set_socktype(void)
{
#ifdef USE_SOCKETS_AS_HANDLES
#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
dTHX;
if (!w32_init_socktype) {
#endif
int iSockOpt = SO_SYNCHRONOUS_NONALERT;
/*
* Enable the use of sockets as filehandles
*/
setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
(char *)&iSockOpt, sizeof(iSockOpt));
#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
w32_init_socktype = 1;
}
#endif
#endif /* USE_SOCKETS_AS_HANDLES */
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
