//err 错误信息列表 namespace wsock.err; /* 套接字错误代码详细说明 https://learn.microsoft.com/zh-cn/windows/win32/winsock/windows-sockets-error-codes-2 */ message = { [6]="Specified event object handle is invalid"; [8]="Insufficient memory available"; [87]="One or more parameters are invalid"; [995]="Overlapped operation aborted"; [996]="Overlapped I/O event object not in signaled state"; [997]="Overlapped operations will complete later"; [10004]="Interrupted function call"; [10009]="File handle is not valid"; [10013]="Permission denied"; //端口被占用参考inet.stat() [10014]="Bad address"; [10022]="Invalid argument"; [10024]="Too many open files"; [10035]="Resource temporarily unavailable"; [10036]="Operation now in progress"; [10037]="Operation already in progress"; [10038]="Socket operation on nonsocket"; [10039]="Destination address required"; [10040]="Message too long"; [10041]="Protocol wrong type for socket"; [10042]="Bad protocol option"; [10043]="Protocol not supported"; [10044]="Socket type not supported"; [10045]="Operation not supported"; [10046]="Protocol family not supported"; [10047]="Address family not supported by protocol family"; [10048]="Address already in use"; [10049]="Cannot assign requested address"; [10050]="Network is down"; [10051]="Network is unreachable"; [10052]="Network dropped connection on reset"; [10053]="Software caused connection abort"; [10054]="Connection reset by peer"; [10055]="No buffer space available"; [10056]="Socket is already connected"; [10057]="Socket is not connected"; [10058]="Cannot send after socket shutdown"; [10059]="Too many references"; [10060]="Connection timed out"; [10061]="Connection refused"; [10062]="Cannot translate name"; [10063]="Name too long"; [10064]="Host is down"; [10065]="No route to host"; [10066]="Directory not empty"; [10067]="Too many processes"; [10068]="User quota exceeded"; [10069]="Disk quota exceeded"; [10070]="Stale file handle reference"; [10071]="Item is remote"; [10091]="Network subsystem is unavailable"; [10092]="Winsock.dll version out of range"; [10093]="Successful WSAStartup not yet performed"; [10101]="Graceful shutdown in progress"; [10102]="No more results"; [10103]="Call has been canceled"; [10104]="Procedure call table is invalid"; [10105]="Service provider is invalid"; [10106]="Service provider failed to initialize"; [10107]="System call failure"; [10108]="Service not found"; [10109]="Class type not found"; [10110]="No more results"; [10111]="Call was canceled"; [10112]="Database query was refused"; [11001]="Host not found"; [11002]="Nonauthoritative host not found"; [11003]="This is a nonrecoverable error"; [11004]="Valid name, no data record of requested type"; [11005]="QoS receivers"; [11006]="QoS senders"; [11007]="No QoS senders"; [11008]="QoS no receivers"; [11009]="QoS request confirmed"; [11010]="QoS admission error"; [11011]="QoS policy failure"; [11012]="QoS bad style"; [11013]="QoS bad object"; [11014]="QoS traffic control error"; [11015]="QoS generic error"; [11016]="QoS service type error"; [11017]="QoS flowspec error"; [11018]="Invalid QoS provider buffer"; [11019]="Invalid QoS filter style"; [11020]="Invalid QoS filter type"; [11021]="Incorrect QoS filter count"; [11022]="Invalid QoS object length"; [11023]="Incorrect QoS flow count"; [11024]="Unrecognized QoS object"; [11025]="Invalid QoS policy object"; [11026]="Invalid QoS flow descriptor"; [11027]="Invalid QoS provider-specific flowspec"; [11028]="Invalid QoS provider-specific filterspec"; [11029]="Invalid QoS shape discard mode object"; [11030]="Invalid QoS shaping rate object"; [11031]="Reserved policy QoS element type"; } function lasterr(err) { if(err === null) err = ::Ws2_32.WSAGetLastError() if(!err)return; var msg = message[err] if(!msg) return ..lasterr(err); else msg = msg + " #" + err; return msg,err; } /*intellisense(wsock.err) lasterr() = 可选在参数中指定错误代码,\n返回值为错误信息,错误码,\n没有错误则返回null\n[错误信息中文版](http://support.microsoft.com/kb/819124) end intellisense*/ /*****intellisense() _WSAEINTR=@10004/*_WSAEINTR*/ _WSAEBADF=@10009/*_WSAEBADF*/ _WSAEACCES=@10013/*_WSAEACCES*/ _WSAEFAULT=@10014/*_WSAEFAULT*/ _WSAEINVAL=@10022/*_WSAEINVAL*/ _WSAEMFILE=@10024/*_WSAEMFILE*/ _WSAEWOULDBLOCK=@10035/*_WSAEWOULDBLOCK*/ _WSAEINPROGRESS=@10036/*_WSAEINPROGRESS*/ _WSAEALREADY=@10037/*_WSAEALREADY*/ _WSAENOTSOCK=@10038/*_WSAENOTSOCK*/ _WSAEDESTADDRREQ=@10039/*_WSAEDESTADDRREQ*/ _WSAEMSGSIZE=@10040/*_WSAEMSGSIZE*/ _WSAEPROTOTYPE=@10041/*_WSAEPROTOTYPE*/ _WSAEPROTOOPT=@10042/*_WSAEPROTOOPT*/ _WSAEPROTONOSUPPORT=@10043/*_WSAEPROTONOSUPPORT*/ _WSAESOCKTNOSUPPORT=@10044/*_WSAESOCKTNOSUPPORT*/ _WSAEOPNOTSUPP=@10045/*_WSAEOPNOTSUPP*/ _WSAEPFNOSUPPORT=@10046/*_WSAEPFNOSUPPORT*/ _WSAEAFNOSUPPORT=@10047/*_WSAEAFNOSUPPORT*/ _WSAEADDRINUSE=@10048/*_WSAEADDRINUSE*/ _WSAEADDRNOTAVAIL=@10049/*_WSAEADDRNOTAVAIL*/ _WSAENETDOWN=@10050/*_WSAENETDOWN*/ _WSAENETUNREACH=@10051/*_WSAENETUNREACH*/ _WSAENETRESET=@10052/*_WSAENETRESET*/ _WSAECONNABORTED=@10053/*_WSAECONNABORTED*/ _WSAECONNRESET=@10054/*_WSAECONNRESET*/ _WSAENOBUFS=@10055/*_WSAENOBUFS*/ _WSAEISCONN=@10056/*_WSAEISCONN*/ _WSAENOTCONN=@10057/*_WSAENOTCONN*/ _WSAESHUTDOWN=@10058/*_WSAESHUTDOWN*/ _WSAETOOMANYREFS=@10059/*_WSAETOOMANYREFS*/ _WSAETIMEDOUT=@10060/*_WSAETIMEDOUT*/ _WSAECONNREFUSED=@10061/*_WSAECONNREFUSED*/ _WSAELOOP=@10062/*_WSAELOOP*/ _WSAENAMETOOLONG=@10063/*_WSAENAMETOOLONG*/ _WSAEHOSTDOWN=@10064/*_WSAEHOSTDOWN*/ _WSAEHOSTUNREACH=@10065/*_WSAEHOSTUNREACH*/ _WSAENOTEMPTY=@10066/*_WSAENOTEMPTY*/ _WSAEPROCLIM=@10067/*_WSAEPROCLIM*/ _WSAEUSERS=@10068/*_WSAEUSERS*/ _WSAEDQUOT=@10069/*_WSAEDQUOT*/ _WSAESTALE=@10070/*_WSAESTALE*/ _WSAEREMOTE=@10071/*_WSAEREMOTE*/ _WSASYSNOTREADY=@10091/*_WSASYSNOTREADY*/ _WSAVERNOTSUPPORTED=@10092/*_WSAVERNOTSUPPORTED*/ _WSANOTINITIALISED=@10093/*_WSANOTINITIALISED*/ end intellisense*****/