-
April 23rd, 2010, 11:14 AM
#1
Socket error 10038
Hi,
I have the following function which is called by several other programs.
I am getting the socket error 10038, which means socket operation on a non socket. How do I go about troubleshooting?
How do I know which thread is calling this function?
Code:
int CSocHandler::sendAll(char * cSendBuffer, int length) {
if (length <=0) {
return 0;
}
int iTotalBytesSent = 0;
do {
int iBytesSent = ::send( sock, &cSendBuffer[iTotalBytesSent], length-iTotalBytesSent , 0);
Yield();
if (iBytesSent <= 0) {
int iErrorCode = WSAGetLastError();
cout << "\nSocket error in CSocHandler::sendAll : " << iErrorCode;
cout << " - Buffer: " << cSendBuffer << endl;
break;
}
iTotalBytesSent +=iBytesSent;
} while (iTotalBytesSent < length);
return iTotalBytesSent;
}
-
April 24th, 2010, 01:59 PM
#2
Re: Socket error 10038
Read MSDN
WSAENOTSOCK
10038
Socket operation on nonsocket.
An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.
Victor Nijegorodov
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|