Share via


Socket error codes

Question

Friday, July 13, 2007 4:27 PM

 I am currently using Visual Studio 6, MFC application with windowsXP.

From the CSocket.Send method i am getting error -1.

The GetLastError method returns 10093.

I am unable to find a list of error code numbers anywhere in the documentation( although I can find some other error codes).

Can you either translate this error or show me where to look.

Regards

BoatProg

All replies (4)

Friday, July 13, 2007 4:46 PM ✅Answered

10093 means WSANOTINITIALIZED, ie, you haven't initialised Windows Sockets in your application.

 

To get the system error codes you can look in the GetLastError function description in the MSDN, it has a link to system error codes there. If you are still stuck, use the following link http://msdn2.microsoft.com/en-us/library/ms681381(VS.80).aspx


Friday, July 13, 2007 5:50 PM ✅Answered

In the VC menu use "Tools | Error Lookup"; using that to lookup 10093 you will get:

Either the application has not called WSAStartup, or WSAStartup failed.

Or you can use look at the documentation of the GetLastError function; the part that says:

To obtain an error string for system error codes, use

Or you can open the winerror.h file.


Saturday, July 14, 2007 10:51 AM

Thanks crescens2k


Saturday, July 14, 2007 10:52 AM

Thanks Simple Samples