Home > Back-end >  Have used WSAStartup initial success, but failed to create a socket, how is this to return a respons
Have used WSAStartup initial success, but failed to create a socket, how is this to return a respons

Time:09-16

Have used WSAStartup initial success, but failed to create a socket, how is this to return a responsibility excuse me?

CodePudding user response:

WSAGetLastError see error code to find the reason, but I think should be your code wrong

CodePudding user response:

reference 1st floor qq_40162781 response:
WSAGetLastError see error code to find the reason, but I think should be an error in the code you

Thank you very much, is now able to create a socket, but an error in the setsockopt, code: the setsockopt (sock, IPPROTO_IP IP_HDRINCL, (char *) & amp; Flag, sizeof (flag)) there were 10022 error, the parameters in this piece of code I have mistakes?

CodePudding user response:

refer to the second floor weixin_43454098 response:
Quote: refer to 1st floor qq_40162781 response:

WSAGetLastError see error code to find the reason, but I think should be an error in the code you

Thank you very much, is now able to create a socket, but an error in the setsockopt, code: the setsockopt (sock, IPPROTO_IP IP_HDRINCL, (char *) & amp; Flag, sizeof (flag)) there were 10022 error, the parameters in this piece of code I have mistakes?

This code after I changed to such a success: the setsockopt (sock, SOL_SOCKET, SO_RCVTIMEO, (CHAR *) & amp; Flag, sizeof (flag))
But here and there were 10022 error: WSAIoctl (sock, IO_RCVALL, & amp; DwBufferInLen, sizeof (dwBufferInLen), & amp; DwBufferLen, sizeof (dwBufferLen), & amp; DwBytesReturned, NULL, NULL)
How is this to return a responsibility excuse me?
  • Related