Forum Discussion
JVD66
Mar 09, 2021Copper Contributor
winsock2 's recvfrom and recv both return extended error 10045 for bound UDP socket - why?
I have some C code using winsock2 : int fd = socket ( AF_INET, SOCK_DGRAM, IPPROTO_UDP ); struct sockaddr_in sin = { ... }; if (fd == -1) _ERR_( ... ) ... if (...
JVD66
Mar 09, 2021Copper Contributor
I have tried using recv, recvfrom, and ReadFile. recv and recvfrom return SOCKET_ERROR + Extended Error 10045, while ReadFile returns error 87,
'The parameter is incorrect'.
It appears that somehow ioctlsocket( fd, FIONREAD, &bytes_available) , though it returns 0 (success) , and returns a positive number in 'bytes_available', is somehow making 'fd' an invalid file handle ?
Are there any known workarounds, or a good open-source replacement for WinSock2.DLL ?
'The parameter is incorrect'.
It appears that somehow ioctlsocket( fd, FIONREAD, &bytes_available) , though it returns 0 (success) , and returns a positive number in 'bytes_available', is somehow making 'fd' an invalid file handle ?
Are there any known workarounds, or a good open-source replacement for WinSock2.DLL ?