====== Winsock ====== Socket API pour Windows. [[http://msdn.microsoft.com/en-us/library/ms740673%28VS.85%29.aspx|Windows Sockets 2 on MSDN]]. ===== Tips & Tricks ===== ==== Winsock Error Code pour dotNat C# ==== [[http://msdn.microsoft.com/en-us/library/ms740668%28VS.85%29.aspx|Windows Sockets Error Codes]] on MSDN using System; namespace WinSock { /// /// Description résumée de WinSock. /// public sealed class Error { private Error() { } public const int WSABASEERR = 10000; /* * Windows Sockets definitions of regular Microsoft C error constants */ /// /// Interrupted function call. /// A blocking operation was interrupted by a call to WSACancelBlockingCall. /// public const int WSAEINTR = ( WSABASEERR + 4 ); public const int WSAEBADF = ( WSABASEERR + 9 ); public const int WSAEACCES = ( WSABASEERR + 13 ); public const int WSAEFAULT = ( WSABASEERR + 14 ); public const int WSAEINVAL = ( WSABASEERR + 22 ); public const int WSAEMFILE = ( WSABASEERR + 24 ); /* * Windows Sockets definitions of regular Berkeley error constants */ public const int WSAEWOULDBLOCK = ( WSABASEERR + 35 ); public const int WSAEINPROGRESS = ( WSABASEERR + 36 ); public const int WSAEALREADY = ( WSABASEERR + 37 ); public const int WSAENOTSOCK = ( WSABASEERR + 38 ); public const int WSAEDESTADDRREQ = ( WSABASEERR + 39 ); public const int WSAEMSGSIZE = ( WSABASEERR + 40 ); public const int WSAEPROTOTYPE = ( WSABASEERR + 41 ); public const int WSAENOPROTOOPT = ( WSABASEERR + 42 ); public const int WSAEPROTONOSUPPORT = ( WSABASEERR + 43 ); public const int WSAESOCKTNOSUPPORT = ( WSABASEERR + 44 ); public const int WSAEOPNOTSUPP = ( WSABASEERR + 45 ); public const int WSAEPFNOSUPPORT = ( WSABASEERR + 46 ); public const int WSAEAFNOSUPPORT = ( WSABASEERR + 47 ); public const int WSAEADDRINUSE = ( WSABASEERR + 48 ); public const int WSAEADDRNOTAVAIL = ( WSABASEERR + 49 ); public const int WSAENETDOWN = ( WSABASEERR + 50 ); public const int WSAENETUNREACH = ( WSABASEERR + 51 ); public const int WSAENETRESET = ( WSABASEERR + 52 ); public const int WSAECONNABORTED = ( WSABASEERR + 53 ); public const int WSAECONNRESET = ( WSABASEERR + 54 ); public const int WSAENOBUFS = ( WSABASEERR + 55 ); public const int WSAEISCONN = ( WSABASEERR + 56 ); public const int WSAENOTCONN = ( WSABASEERR + 57 ); public const int WSAESHUTDOWN = ( WSABASEERR + 58 ); public const int WSAETOOMANYREFS = ( WSABASEERR + 59 ); public const int WSAETIMEDOUT = ( WSABASEERR + 60 ); public const int WSAECONNREFUSED = ( WSABASEERR + 61 ); public const int WSAELOOP = ( WSABASEERR + 62 ); public const int WSAENAMETOOLONG = ( WSABASEERR + 63 ); public const int WSAEHOSTDOWN = ( WSABASEERR + 64 ); public const int WSAEHOSTUNREACH = ( WSABASEERR + 65 ); public const int WSAENOTEMPTY = ( WSABASEERR + 66 ); public const int WSAEPROCLIM = ( WSABASEERR + 67 ); public const int WSAEUSERS = ( WSABASEERR + 68 ); public const int WSAEDQUOT = ( WSABASEERR + 69 ); public const int WSAESTALE = ( WSABASEERR + 70 ); public const int WSAEREMOTE = ( WSABASEERR + 71 ); /* * Extended Windows Sockets error constant definitions */ public const int WSASYSNOTREADY = ( WSABASEERR + 91 ); public const int WSAVERNOTSUPPORTED = ( WSABASEERR + 92 ); public const int WSANOTINITIALISED = ( WSABASEERR + 93 ); public const int WSAEDISCON = ( WSABASEERR + 101 ); public const int WSAENOMORE = ( WSABASEERR + 102 ); public const int WSAECANCELLED = ( WSABASEERR + 103 ); public const int WSAEINVALIDPROCTABLE = ( WSABASEERR + 104 ); public const int WSAEINVALIDPROVIDER = ( WSABASEERR + 105 ); public const int WSAEPROVIDERFAILEDINIT = ( WSABASEERR + 106 ); public const int WSASYSCALLFAILURE = ( WSABASEERR + 107 ); public const int WSASERVICE_NOT_FOUND = ( WSABASEERR + 108 ); public const int WSATYPE_NOT_FOUND = ( WSABASEERR + 109 ); public const int WSA_E_NO_MORE = ( WSABASEERR + 110 ); public const int WSA_E_CANCELLED = ( WSABASEERR + 111 ); public const int WSAEREFUSED = ( WSABASEERR + 112 ); /* * Error return codes from gethostbyname(); and gethostbyaddr(); *= (when using the resolver);. Note that these errors are * retrieved via WSAGetLastError(); and must therefore follow * the rules for avoiding clashes with error numbers from * specific implementations or language run-time systems. * For this reason the codes are based at WSABASEERR+1001. * Note also that [WSA]NO_ADDRESS is defined only for * compatibility purposes. */ /* Authoritative Answer: Host not found */ public const int WSAHOST_NOT_FOUND = ( WSABASEERR + 1001 ); /* Non-Authoritative: Host not found, or SERVERFAIL */ public const int WSATRY_AGAIN = ( WSABASEERR + 1002 ); /* Non-recoverable errors, FORMERR, REFUSED, NOTIMP */ public const int WSANO_RECOVERY = ( WSABASEERR + 1003 ); /* Valid name, no data record of requested type */ public const int WSANO_DATA = ( WSABASEERR + 1004 ); } }