📄 psiwinsock.pas
字号:
SO_MAXDG = $7009;
SO_MAXPATHDG = $700A;
SO_UPDATE_ACCEPT_CONTEXT = $700B;
SO_CONNECT_TIME = $700C;
{ TCP options. }
TCP_NODELAY = $0001;
TCP_BSDURGENT = $7000;
{ Address families. }
AF_UNSPEC = 0; { unspecified }
AF_UNIX = 1; { local to host (pipes, portals) }
AF_INET = 2; { internetwork: UDP, TCP, etc. }
AF_IMPLINK = 3; { arpanet imp addresses }
AF_PUP = 4; { pup protocols: e.g. BSP }
AF_CHAOS = 5; { mit CHAOS protocols }
AF_IPX = 6; { IPX and SPX }
AF_NS = 6; { XEROX NS protocols }
AF_ISO = 7; { ISO protocols }
AF_OSI = AF_ISO; { OSI is ISO }
AF_ECMA = 8; { european computer manufacturers }
AF_DATAKIT = 9; { datakit protocols }
AF_CCITT = 10; { CCITT protocols, X.25 etc }
AF_SNA = 11; { IBM SNA }
AF_DECnet = 12; { DECnet }
AF_DLI = 13; { Direct data link interface }
AF_LAT = 14; { LAT }
AF_HYLINK = 15; { NSC Hyperchannel }
AF_APPLETALK = 16; { AppleTalk }
AF_NETBIOS = 17; { NetBios-style addresses }
AF_VOICEVIEW = 18; { VoiceView }
AF_FIREFOX = 19; { FireFox }
AF_UNKNOWN1 = 20; { Somebody is using this! }
AF_BAN = 21; { Banyan }
AF_MAX = 22;
type
{ Structure used by kernel to store most addresses. }
PSOCKADDR = ^TSockAddr;
TSockAddr = sockaddr_in;
{ Structure used by kernel to pass protocol information in raw sockets. }
PSockProto = ^TSockProto;
sockproto = record
sp_family: u_short;
sp_protocol: u_short;
end;
TSockProto = sockproto;
const
{ Protocol families, same as address families for now. }
PF_UNSPEC = AF_UNSPEC;
PF_UNIX = AF_UNIX;
PF_INET = AF_INET;
PF_IMPLINK = AF_IMPLINK;
PF_PUP = AF_PUP;
PF_CHAOS = AF_CHAOS;
PF_NS = AF_NS;
PF_IPX = AF_IPX;
PF_ISO = AF_ISO;
PF_OSI = AF_OSI;
PF_ECMA = AF_ECMA;
PF_DATAKIT = AF_DATAKIT;
PF_CCITT = AF_CCITT;
PF_SNA = AF_SNA;
PF_DECnet = AF_DECnet;
PF_DLI = AF_DLI;
PF_LAT = AF_LAT;
PF_HYLINK = AF_HYLINK;
PF_APPLETALK = AF_APPLETALK;
PF_VOICEVIEW = AF_VOICEVIEW;
PF_FIREFOX = AF_FIREFOX;
PF_UNKNOWN1 = AF_UNKNOWN1;
PF_BAN = AF_BAN;
PF_MAX = AF_MAX;
type
{ Structure used for manipulating linger option. }
PLinger = ^TLinger;
linger = record
l_onoff: u_short;
l_linger: u_short;
end;
TLinger = linger;
const
{ Level number for (get/set)sockopt() to apply to socket itself. }
SOL_SOCKET = $ffff; {options for socket level }
{ Maximum queue length specifiable by listen. }
SOMAXCONN = 5;
MSG_OOB = $1; {process out-of-band data }
MSG_PEEK = $2; {peek at incoming message }
MSG_DONTROUTE = $4; {send without using routing tables }
MSG_MAXIOVLEN = 16;
MSG_PARTIAL = $8000; {partial send or recv for message xport }
{ Define constant based on rfc883, used by gethostbyxxxx() calls. }
MAXGETHOSTSTRUCT = 1024;
{ Define flags to be used with the WSAAsyncSelect() call. }
FD_READ = $01;
FD_WRITE = $02;
FD_OOB = $04;
FD_ACCEPT = $08;
FD_CONNECT = $10;
FD_CLOSE = $20;
{ All Windows Sockets error constants are biased by WSABASEERR from the "normal" }
{$NODEFINE WSABASEERR}
WSABASEERR = 10000;
{ Windows Sockets definitions of regular Microsoft C error constants }
{$NODEFINE WSAEINTR }
WSAEINTR = (WSABASEERR+4);
{$NODEFINE WSAEBADF }
WSAEBADF = (WSABASEERR+9);
{$NODEFINE WSAEACCES }
WSAEACCES = (WSABASEERR+13);
{$NODEFINE WSAEFAULT }
WSAEFAULT = (WSABASEERR+14);
{$NODEFINE WSAEINVAL }
WSAEINVAL = (WSABASEERR+22);
{$NODEFINE WSAEMFILE }
WSAEMFILE = (WSABASEERR+24);
{ Windows Sockets definitions of regular Berkeley error constants }
{$NODEFINE WSAEWOULDBLOCK }
WSAEWOULDBLOCK = (WSABASEERR+35);
{$NODEFINE WSAEINPROGRESS }
WSAEINPROGRESS = (WSABASEERR+36);
{$NODEFINE WSAEALREADY }
WSAEALREADY = (WSABASEERR+37);
{$NODEFINE WSAENOTSOCK }
WSAENOTSOCK = (WSABASEERR+38);
{$NODEFINE WSAEDESTADDRREQ }
WSAEDESTADDRREQ = (WSABASEERR+39);
{$NODEFINE WSAEMSGSIZE }
WSAEMSGSIZE = (WSABASEERR+40);
{$NODEFINE WSAEPROTOTYPE }
WSAEPROTOTYPE = (WSABASEERR+41);
{$NODEFINE WSAENOPROTOOPT }
WSAENOPROTOOPT = (WSABASEERR+42);
{$NODEFINE WSAEPROTONOSUPPORT }
WSAEPROTONOSUPPORT = (WSABASEERR+43);
{$NODEFINE WSAESOCKTNOSUPPORT }
WSAESOCKTNOSUPPORT = (WSABASEERR+44);
{$NODEFINE WSAEOPNOTSUPP }
WSAEOPNOTSUPP = (WSABASEERR+45);
{$NODEFINE WSAEPFNOSUPPORT }
WSAEPFNOSUPPORT = (WSABASEERR+46);
{$NODEFINE WSAEAFNOSUPPORT }
WSAEAFNOSUPPORT = (WSABASEERR+47);
{$NODEFINE WSAEADDRINUSE }
WSAEADDRINUSE = (WSABASEERR+48);
{$NODEFINE WSAEADDRNOTAVAIL }
WSAEADDRNOTAVAIL = (WSABASEERR+49);
{$NODEFINE WSAENETDOWN }
WSAENETDOWN = (WSABASEERR+50);
{$NODEFINE WSAENETUNREACH }
WSAENETUNREACH = (WSABASEERR+51);
{$NODEFINE WSAENETRESET }
WSAENETRESET = (WSABASEERR+52);
{$NODEFINE WSAECONNABORTED }
WSAECONNABORTED = (WSABASEERR+53);
{$NODEFINE WSAECONNRESET }
WSAECONNRESET = (WSABASEERR+54);
{$NODEFINE WSAENOBUFS }
WSAENOBUFS = (WSABASEERR+55);
{$NODEFINE WSAEISCONN }
WSAEISCONN = (WSABASEERR+56);
{$NODEFINE WSAENOTCONN }
WSAENOTCONN = (WSABASEERR+57);
{$NODEFINE WSAESHUTDOWN }
WSAESHUTDOWN = (WSABASEERR+58);
{$NODEFINE WSAETOOMANYREFS }
WSAETOOMANYREFS = (WSABASEERR+59);
{$NODEFINE WSAETIMEDOUT }
WSAETIMEDOUT = (WSABASEERR+60);
{$NODEFINE WSAECONNREFUSED }
WSAECONNREFUSED = (WSABASEERR+61);
{$NODEFINE WSAELOOP }
WSAELOOP = (WSABASEERR+62);
{$NODEFINE WSAENAMETOOLONG }
WSAENAMETOOLONG = (WSABASEERR+63);
{$NODEFINE WSAEHOSTDOWN }
WSAEHOSTDOWN = (WSABASEERR+64);
{$NODEFINE WSAEHOSTUNREACH }
WSAEHOSTUNREACH = (WSABASEERR+65);
{$NODEFINE WSAENOTEMPTY }
WSAENOTEMPTY = (WSABASEERR+66);
{$NODEFINE WSAEPROCLIM }
WSAEPROCLIM = (WSABASEERR+67);
{$NODEFINE WSAEUSERS }
WSAEUSERS = (WSABASEERR+68);
{$NODEFINE WSAEDQUOT }
WSAEDQUOT = (WSABASEERR+69);
{$NODEFINE WSAESTALE }
WSAESTALE = (WSABASEERR+70);
{$NODEFINE WSAEREMOTE }
WSAEREMOTE = (WSABASEERR+71);
{$NODEFINE WSAEDISCON }
WSAEDISCON = (WSABASEERR+101);
{ Extended Windows Sockets error constant definitions }
{$NODEFINE WSASYSNOTREADY }
WSASYSNOTREADY = (WSABASEERR+91);
{$NODEFINE WSAVERNOTSUPPORTED }
WSAVERNOTSUPPORTED = (WSABASEERR+92);
{$NODEFINE WSANOTINITIALISED }
WSANOTINITIALISED = (WSABASEERR+93);
{ 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 }
{$NODEFINE WSAHOST_NOT_FOUND }
WSAHOST_NOT_FOUND = (WSABASEERR+1001);
{$NODEFINE HOST_NOT_FOUND }
HOST_NOT_FOUND = WSAHOST_NOT_FOUND;
{ Non-Authoritative: Host not found, or SERVERFAIL }
{$NODEFINE WSATRY_AGAIN }
WSATRY_AGAIN = (WSABASEERR+1002);
{$NODEFINE TRY_AGAIN }
TRY_AGAIN = WSATRY_AGAIN;
{ Non recoverable errors, FORMERR, REFUSED, NOTIMP }
{$NODEFINE WSANO_RECOVERY }
WSANO_RECOVERY = (WSABASEERR+1003);
{$NODEFINE NO_RECOVERY }
NO_RECOVERY = WSANO_RECOVERY;
{ Valid name, no data record of requested type }
{$NODEFINE WSANO_DATA }
WSANO_DATA = (WSABASEERR+1004);
{$NODEFINE NO_DATA }
NO_DATA = WSANO_DATA;
{ no address, look for MX record }
{$NODEFINE WSANO_ADDRESS }
WSANO_ADDRESS = WSANO_DATA;
{$NODEFINE NO_ADDRESS }
NO_ADDRESS = WSANO_ADDRESS;
{ Windows Sockets errors redefined as regular Berkeley error constants.
These are commented out in Windows NT to avoid conflicts with errno.h.
Use the WSA constants instead. }
{$NODEFINE EWOULDBLOCK }
EWOULDBLOCK = WSAEWOULDBLOCK;
{$NODEFINE EINPROGRESS }
EINPROGRESS = WSAEINPROGRESS;
{$NODEFINE EALREADY }
EALREADY = WSAEALREADY;
{$NODEFINE ENOTSOCK }
ENOTSOCK = WSAENOTSOCK;
{$NODEFINE EDESTADDRREQ }
EDESTADDRREQ = WSAEDESTADDRREQ;
{$NODEFINE EMSGSIZE }
EMSGSIZE = WSAEMSGSIZE;
{$NODEFINE EPROTOTYPE }
EPROTOTYPE = WSAEPROTOTYPE;
{$NODEFINE ENOPROTOOPT }
ENOPROTOOPT = WSAENOPROTOOPT;
{$NODEFINE EPROTONOSUPPORT }
EPROTONOSUPPORT = WSAEPROTONOSUPPORT;
{$NODEFINE ESOCKTNOSUPPORT }
ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT;
{$NODEFINE EOPNOTSUPP }
EOPNOTSUPP = WSAEOPNOTSUPP;
{$NODEFINE EPFNOSUPPORT }
EPFNOSUPPORT = WSAEPFNOSUPPORT;
{$NODEFINE EAFNOSUPPORT }
EAFNOSUPPORT = WSAEAFNOSUPPORT;
{$NODEFINE EADDRINUSE }
EADDRINUSE = WSAEADDRINUSE;
{$NODEFINE EADDRNOTAVAIL }
EADDRNOTAVAIL = WSAEADDRNOTAVAIL;
{$NODEFINE ENETDOWN }
ENETDOWN = WSAENETDOWN;
{$NODEFINE ENETUNREACH }
ENETUNREACH = WSAENETUNREACH;
{$NODEFINE ENETRESET }
ENETRESET = WSAENETRESET;
{$NODEFINE ECONNABORTED }
ECONNABORTED = WSAECONNABORTED;
{$NODEFINE ECONNRESET }
ECONNRESET = WSAECONNRESET;
{$NODEFINE ENOBUFS }
ENOBUFS = WSAENOBUFS;
{$NODEFINE EISCONN }
EISCONN = WSAEISCONN;
{$NODEFINE ENOTCONN }
ENOTCONN = WSAENOTCONN;
{$NODEFINE ESHUTDOWN }
ESHUTDOWN = WSAESHUTDOWN;
{$NODEFINE ETOOMANYREFS }
ETOOMANYREFS = WSAETOOMANYREFS;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -