替换wsock32.dll,增加了delphi的winsock.pas中没有的一些函数,包括mswsock.dll和ws2_32.dll中的函数.(50分)

  • 主题发起人 主题发起人 qfgj
  • 开始时间 开始时间
Q

qfgj

Unregistered / Unconfirmed
GUEST, unregistred user!
出下面的错:the procedure entry point wsastartup could not be located in the dynamic link library wsock32.dll,高手帮忙看一下<br><br>源程序如下:增加了delphi的winsock.pas中没有的一些函数,包括mswsock.dll和ws2_32.dll中的函数.<br><br>library wsock32;<br><br>uses<br>&nbsp; WinSock in 'WinSock.pas';<br><br>exports<br>AcceptEx index 1141 ,// MSWSOCK.AcceptEx<br>EnumProtocolsA index 1111 ,// MSWSOCK.EnumProtocolsA<br>EnumProtocolsW index 1112 ,// MSWSOCK.EnumProtocolsW<br>GetAcceptExSockaddrs index 1142 ,// MSWSOCK.GetAcceptExSockaddrs<br>GetAddressByNameA index 1109 ,// MSWSOCK.GetAddressByNameA<br>GetAddressByNameW index 1110 ,// MSWSOCK.GetAddressByNameW<br>GetNameByTypeA index 1115 ,// MSWSOCK.GetNameByTypeA<br>GetNameByTypeW index 1116 ,// MSWSOCK.GetNameByTypeW<br>GetServiceA index 1119 ,// MSWSOCK.GetServiceA<br>GetServiceW index 1120 ,// MSWSOCK.GetServiceW<br>GetTypeByNameA index 1113 ,// MSWSOCK.GetTypeByNameA<br>GetTypeByNameW index 1114 ,// MSWSOCK.GetTypeByNameW<br>MigrateWinsockConfiguration index 24 ,// MSWSOCK.MigrateWinsockConfiguration<br>NPLoadNameSpaces index 1130 ,// MSWSOCK.NPLoadNameSpaces<br>SetServiceA index 1117 ,// MSWSOCK.SetServiceA<br>SetServiceW index 1118 ,// MSWSOCK.SetServiceW<br>TransmitFile index 1140 ,// MSWSOCK.TransmitFile<br>WSARecvEx index 1107 ,// MSWSOCK.WSARecvEx<br>dn_expand index 1106 ,// MSWSOCK.dn_expand<br>inet_network index 1100 ,// MSWSOCK.inet_network<br>getnetbyname index 1101 ,// MSWSOCK.getnetbyname<br>rcmd index 1102 ,// MSWSOCK.rcmd<br>rexec index 1103 ,// MSWSOCK.rexec<br>rresvport index 1104 ,// MSWSOCK.rresvport<br>s_perror index 1108 ,// MSWSOCK.s_perror<br>sethostname index 1105 ,// MSWSOCK.sethostname<br><br>WEP index 500 ,// ws2_32.WEP<br>WSAAsyncGetHostByAddr index 102 ,// ws2_32.WSAAsyncGetHostByAddr<br>WSAAsyncGetHostByName index 103 ,// ws2_32.WSAAsyncGetHostByName<br>WSAAsyncGetProtoByName index 105 ,// ws2_32.WSAAsyncGetProtoByName<br>WSAAsyncGetProtoByNumber index 104 ,// ws2_32.WSAAsyncGetProtoByNumber<br>WSAAsyncGetServByName index 107 ,// ws2_32.WSAAsyncGetServByName<br>WSAAsyncGetServByPort index 106 ,// ws2_32.WSAAsyncGetServByPort<br>WSAAsyncSelect index 101 ,// ws2_32.WSAAsyncSelect<br>WSACancelAsyncRequest index 108 ,// ws2_32.WSACancelAsyncRequest<br>WSACancelBlockingCall index 113 ,// ws2_32.WSACancelBlockingCall<br>WSACleanup index 116 ,// ws2_32.WSACleanup<br>WSAGetLastError index 111 ,// ws2_32.WSAGetLastError<br>WSAIsBlocking index 114 ,// ws2_32.WSAIsBlocking<br>WSASetBlockingHook index 109 ,// ws2_32.WSASetBlockingHook<br>WSASetLastError index 112 ,// ws2_32.WSASetLastError<br>WSAStartup index 115 ,// ws2_32.WSAStartup<br>WSAUnhookBlockingHook index 110 ,// ws2_32.WSAUnhookBlockingHook<br>WSApSetPostRoutine index 1000 ,// ws2_32.WSApSetPostRoutine<br>__WSAFDIsSet index 151 ,// ws2_32.__WSAFDIsSet<br>accept index 1 ,// ws2_32.accept<br>bind index 2 ,// ws2_32.bind<br>closesocket index 3 ,// ws2_32.closesocket<br>connect index 4 ,// ws2_32.connect<br>gethostbyaddr index 51 ,// ws2_32.gethostbyaddr<br>gethostbyname index 52 ,// ws2_32.gethostbyname<br>gethostname index 57 ,// ws2_32.gethostname<br>getpeername index 5 ,// ws2_32.getpeername<br>getprotobyname index 53 ,// ws2_32.getprotobyname<br>getprotobynumber index 54 ,// ws2_32.getprotobynumber<br>getservbyname index 55 ,// ws2_32.getservbyname<br>getservbyport index 56 ,// ws2_32.getservbyport<br>getsockname index 6 ,// ws2_32.getsockname<br>getsockopt index 7 ,//<br>htonl index 8 ,// ws2_32.htonl<br>htons index 9 ,// ws2_32.htons<br>inet_addr index 10 ,// ws2_32.inet_addr<br>inet_ntoa index 11 ,// ws2_32.inet_ntoa<br>ioctlsocket index 12 ,// ws2_32.ioctlsocket<br>listen index 13 ,// ws2_32.listen<br>ntohl index 14 ,// ws2_32.ntohl<br>ntohs index 15 ,// ws2_32.ntohs<br>select index 18 ,// ws2_32.select<br>send index 19 ,// ws2_32.send<br>sendto index 20 ,// ws2_32.sendto<br>setsockopt index 21 ,//<br>shutdown index 22 ,// ws2_32.shutdown<br>socket index 23, // ws2_32.socket<br><br>recv index 16 ,//<br>recvfrom index 17 ;//<br>{$R *.RES}<br><br>begin<br>end.<br><br>{ *********************************************************************** }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ Delphi Runtime Library &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ Copyright (c) 1996-2001 Borland Software Corporation &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ *********************************************************************** }<br><br>{*******************************************************}<br>{ &nbsp; &nbsp; &nbsp; Win32 sockets API Interface Unit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{*******************************************************}<br><br>unit WinSock;<br><br>{$WEAKPACKAGEUNIT}<br><br>interface<br><br>uses Windows;<br><br>{ HPPEMIT '#include &lt;windows.h&gt;'}<br><br>type<br>&nbsp; {$EXTERNALSYM u_char}<br>&nbsp; u_char = Char;<br>&nbsp; {$EXTERNALSYM u_short}<br>&nbsp; u_short = Word;<br>&nbsp; {$EXTERNALSYM u_int}<br>&nbsp; u_int = Integer;<br>&nbsp; {$EXTERNALSYM u_long}<br>&nbsp; u_long = Longint;<br><br>{ The new type to be used in all<br>&nbsp; instances which refer to sockets. }<br>&nbsp; {$EXTERNALSYM TSocket}<br>&nbsp; TSocket = u_int;<br><br>const<br>&nbsp; {$EXTERNALSYM FD_SETSIZE}<br>&nbsp; FD_SETSIZE &nbsp; &nbsp; = &nbsp; 64;<br><br>// WinSock 2 extension -- manifest constants for shutdown()<br>&nbsp; {$EXTERNALSYM SD_RECEIVE}<br>&nbsp; SD_RECEIVE &nbsp; &nbsp; = 0;<br>&nbsp; {$EXTERNALSYM SD_SEND}<br>&nbsp; SD_SEND &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; {$EXTERNALSYM SD_BOTH}<br>&nbsp; SD_BOTH &nbsp; &nbsp; &nbsp; &nbsp;= 2;<br><br>type<br>// the following emits are a workaround to the name conflict with<br>// procedure FD_SET and struct fd_set in winsock.h<br>(*$HPPEMIT '#include &lt;winsock.h&gt;'*)<br>(*$HPPEMIT 'namespace Winsock'*)<br>(*$HPPEMIT '{'*)<br>(*$HPPEMIT 'typedef fd_set *PFDSet;'*) // due to name conflict with procedure FD_SET<br>(*$HPPEMIT 'typedef fd_set TFDSet;'*) &nbsp;// due to name conflict with procedure FD_SET<br>(*$HPPEMIT '}'*)<br><br>&nbsp; {$NODEFINE PFDSet}<br>&nbsp; PFDSet = ^TFDSet;<br>&nbsp; {$NODEFINE TFDSet}<br>&nbsp; TFDSet = record<br>&nbsp; &nbsp; fd_count: u_int;<br>&nbsp; &nbsp; fd_array: array[0..FD_SETSIZE-1] of TSocket;<br>&nbsp; end;<br><br>&nbsp; PTimeVal = ^TTimeVal;<br>&nbsp; {$EXTERNALSYM timeval}<br>&nbsp; timeval = record<br>&nbsp; &nbsp; tv_sec: Longint;<br>&nbsp; &nbsp; tv_usec: Longint;<br>&nbsp; end;<br>&nbsp; TTimeVal = timeval;<br><br>const<br>&nbsp; {$EXTERNALSYM IOCPARM_MASK}<br>&nbsp; IOCPARM_MASK = $7f;<br>&nbsp; {$EXTERNALSYM IOC_VOID}<br>&nbsp; IOC_VOID &nbsp; &nbsp; = $20000000;<br>&nbsp; {$EXTERNALSYM IOC_OUT}<br>&nbsp; IOC_OUT &nbsp; &nbsp; &nbsp;= $40000000;<br>&nbsp; {$EXTERNALSYM IOC_IN}<br>&nbsp; IOC_IN &nbsp; &nbsp; &nbsp; = $80000000;<br>&nbsp; {$EXTERNALSYM IOC_INOUT}<br>&nbsp; IOC_INOUT &nbsp; &nbsp;= (IOC_IN or IOC_OUT);<br><br>&nbsp; {$EXTERNALSYM FIONREAD}<br>&nbsp; FIONREAD &nbsp; &nbsp; = IOC_OUT or { get # bytes to read }<br>&nbsp; &nbsp; ((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or<br>&nbsp; &nbsp; (Longint(Byte('f')) shl 8) or 127;<br>&nbsp; {$EXTERNALSYM FIONBIO}<br>&nbsp; FIONBIO &nbsp; &nbsp; &nbsp;= IOC_IN or { set/clear non-blocking i/o }<br>&nbsp; &nbsp; ((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or<br>&nbsp; &nbsp; (Longint(Byte('f')) shl 8) or 126;<br>&nbsp; {$EXTERNALSYM FIOASYNC}<br>&nbsp; FIOASYNC &nbsp; &nbsp; = IOC_IN or { set/clear async i/o }<br>&nbsp; &nbsp; ((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or<br>&nbsp; &nbsp; (Longint(Byte('f')) shl 8) or 125;<br><br>type<br>&nbsp; PHostEnt = ^THostEnt;<br>&nbsp; {$EXTERNALSYM hostent}<br>&nbsp; hostent = record<br>&nbsp; &nbsp; h_name: PChar;<br>&nbsp; &nbsp; h_aliases: ^PChar;<br>&nbsp; &nbsp; h_addrtype: Smallint;<br>&nbsp; &nbsp; h_length: Smallint;<br>&nbsp; &nbsp; case Byte of<br>&nbsp; &nbsp; &nbsp; 0: (h_addr_list: ^PChar);<br>&nbsp; &nbsp; &nbsp; 1: (h_addr: ^PChar)<br>&nbsp; end;<br>&nbsp; THostEnt = hostent;<br><br>&nbsp; PNetEnt = ^TNetEnt;<br>&nbsp; {$EXTERNALSYM netent}<br>&nbsp; netent = record<br>&nbsp; &nbsp; n_name: PChar;<br>&nbsp; &nbsp; n_aliases: ^PChar;<br>&nbsp; &nbsp; n_addrtype: Smallint;<br>&nbsp; &nbsp; n_net: u_long;<br>&nbsp; end;<br>&nbsp; TNetEnt = netent;<br><br>&nbsp; PServEnt = ^TServEnt;<br>&nbsp; {$EXTERNALSYM servent}<br>&nbsp; servent = record<br>&nbsp; &nbsp; s_name: PChar;<br>&nbsp; &nbsp; s_aliases: ^PChar;<br>&nbsp; &nbsp; s_port: Word;<br>&nbsp; &nbsp; s_proto: PChar;<br>&nbsp; end;<br>&nbsp; TServEnt = servent;<br><br>&nbsp; PProtoEnt = ^TProtoEnt;<br>&nbsp; {$EXTERNALSYM protoent}<br>&nbsp; protoent = record<br>&nbsp; &nbsp; p_name: PChar;<br>&nbsp; &nbsp; p_aliases: ^Pchar;<br>&nbsp; &nbsp; p_proto: Smallint;<br>&nbsp; end;<br>&nbsp; TProtoEnt = protoent;<br><br>const<br><br>{ Protocols }<br><br>&nbsp; {$EXTERNALSYM IPPROTO_IP}<br>&nbsp; IPPROTO_IP &nbsp; &nbsp; = &nbsp; 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { dummy for IP }<br>&nbsp; {$EXTERNALSYM IPPROTO_ICMP}<br>&nbsp; IPPROTO_ICMP &nbsp; = &nbsp; 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { control message protocol }<br>&nbsp; {$EXTERNALSYM IPPROTO_IGMP}<br>&nbsp; IPPROTO_IGMP &nbsp; = &nbsp; 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { group management protocol }<br>&nbsp; {$EXTERNALSYM IPPROTO_GGP}<br>&nbsp; IPPROTO_GGP &nbsp; &nbsp;= &nbsp; 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { gateway^2 (deprecated) }<br>&nbsp; {$EXTERNALSYM IPPROTO_TCP}<br>&nbsp; IPPROTO_TCP &nbsp; &nbsp;= &nbsp; 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { tcp }<br>&nbsp; {$EXTERNALSYM IPPROTO_PUP}<br>&nbsp; IPPROTO_PUP &nbsp; &nbsp;= &nbsp;12; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { pup }<br>&nbsp; {$EXTERNALSYM IPPROTO_UDP}<br>&nbsp; IPPROTO_UDP &nbsp; &nbsp;= &nbsp;17; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { user datagram protocol }<br>&nbsp; {$EXTERNALSYM IPPROTO_IDP}<br>&nbsp; IPPROTO_IDP &nbsp; &nbsp;= &nbsp;22; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { xns idp }<br>&nbsp; {$EXTERNALSYM IPPROTO_ND}<br>&nbsp; IPPROTO_ND &nbsp; &nbsp; = &nbsp;77; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { UNOFFICIAL net disk proto }<br><br>&nbsp; {$EXTERNALSYM IPPROTO_RAW}<br>&nbsp; IPPROTO_RAW &nbsp; &nbsp;= &nbsp;255; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ raw IP packet }<br>&nbsp; {$EXTERNALSYM IPPROTO_MAX}<br>&nbsp; IPPROTO_MAX &nbsp; &nbsp;= &nbsp;256;<br><br>{ Port/socket numbers: network standard functions}<br><br>&nbsp; {$EXTERNALSYM IPPORT_ECHO}<br>&nbsp; IPPORT_ECHO &nbsp; &nbsp;= &nbsp; 7;<br>&nbsp; {$EXTERNALSYM IPPORT_DISCARD}<br>&nbsp; IPPORT_DISCARD = &nbsp; 9;<br>&nbsp; {$EXTERNALSYM IPPORT_SYSTAT}<br>&nbsp; IPPORT_SYSTAT &nbsp;= &nbsp; 11;<br>&nbsp; {$EXTERNALSYM IPPORT_DAYTIME}<br>&nbsp; IPPORT_DAYTIME = &nbsp; 13;<br>&nbsp; {$EXTERNALSYM IPPORT_NETSTAT}<br>&nbsp; IPPORT_NETSTAT = &nbsp; 15;<br>&nbsp; {$EXTERNALSYM IPPORT_FTP}<br>&nbsp; IPPORT_FTP &nbsp; &nbsp; = &nbsp; 21;<br>&nbsp; {$EXTERNALSYM IPPORT_TELNET}<br>&nbsp; IPPORT_TELNET &nbsp;= &nbsp; 23;<br>&nbsp; {$EXTERNALSYM IPPORT_SMTP}<br>&nbsp; IPPORT_SMTP &nbsp; &nbsp;= &nbsp; 25;<br>&nbsp; {$EXTERNALSYM IPPORT_TIMESERVER}<br>&nbsp; IPPORT_TIMESERVER &nbsp;= &nbsp;37;<br>&nbsp; {$EXTERNALSYM IPPORT_NAMESERVER}<br>&nbsp; IPPORT_NAMESERVER &nbsp;= &nbsp;42;<br>&nbsp; {$EXTERNALSYM IPPORT_WHOIS}<br>&nbsp; IPPORT_WHOIS &nbsp; &nbsp; &nbsp; = &nbsp;43;<br>&nbsp; {$EXTERNALSYM IPPORT_MTP}<br>&nbsp; IPPORT_MTP &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;57;<br><br>{ Port/socket numbers: host specific functions }<br><br>&nbsp; {$EXTERNALSYM IPPORT_TFTP}<br>&nbsp; IPPORT_TFTP &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;69;<br>&nbsp; {$EXTERNALSYM IPPORT_RJE}<br>&nbsp; IPPORT_RJE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;77;<br>&nbsp; {$EXTERNALSYM IPPORT_FINGER}<br>&nbsp; IPPORT_FINGER &nbsp; &nbsp; &nbsp;= &nbsp;79;<br>&nbsp; {$EXTERNALSYM IPPORT_TTYLINK}<br>&nbsp; IPPORT_TTYLINK &nbsp; &nbsp; = &nbsp;87;<br>&nbsp; {$EXTERNALSYM IPPORT_SUPDUP}<br>&nbsp; IPPORT_SUPDUP &nbsp; &nbsp; &nbsp;= &nbsp;95;<br><br>{ UNIX TCP sockets }<br><br>&nbsp; {$EXTERNALSYM IPPORT_EXECSERVER}<br>&nbsp; IPPORT_EXECSERVER &nbsp;= &nbsp;512;<br>&nbsp; {$EXTERNALSYM IPPORT_LOGINSERVER}<br>&nbsp; IPPORT_LOGINSERVER = &nbsp;513;<br>&nbsp; {$EXTERNALSYM IPPORT_CMDSERVER}<br>&nbsp; IPPORT_CMDSERVER &nbsp; = &nbsp;514;<br>&nbsp; {$EXTERNALSYM IPPORT_EFSSERVER}<br>&nbsp; IPPORT_EFSSERVER &nbsp; = &nbsp;520;<br><br>{ UNIX UDP sockets }<br><br>&nbsp; {$EXTERNALSYM IPPORT_BIFFUDP}<br>&nbsp; IPPORT_BIFFUDP &nbsp; &nbsp; = &nbsp;512;<br>&nbsp; {$EXTERNALSYM IPPORT_WHOSERVER}<br>&nbsp; IPPORT_WHOSERVER &nbsp; = &nbsp;513;<br>&nbsp; {$EXTERNALSYM IPPORT_ROUTESERVER}<br>&nbsp; IPPORT_ROUTESERVER = &nbsp;520;<br><br>{ Ports &lt; IPPORT_RESERVED are reserved for<br>&nbsp; privileged processes (e.g. root). }<br><br>&nbsp; {$EXTERNALSYM IPPORT_RESERVED}<br>&nbsp; IPPORT_RESERVED &nbsp; &nbsp;= &nbsp;1024;<br><br>{ Link numbers }<br><br>&nbsp; {$EXTERNALSYM IMPLINK_IP}<br>&nbsp; IMPLINK_IP &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;155;<br>&nbsp; {$EXTERNALSYM IMPLINK_LOWEXPER}<br>&nbsp; IMPLINK_LOWEXPER &nbsp; = &nbsp;156;<br>&nbsp; {$EXTERNALSYM IMPLINK_HIGHEXPER}<br>&nbsp; IMPLINK_HIGHEXPER &nbsp;= &nbsp;158;<br><br>type<br>&nbsp; {$EXTERNALSYM SunB}<br>&nbsp; SunB = packed record<br>&nbsp; &nbsp; s_b1, s_b2, s_b3, s_b4: u_char;<br>&nbsp; end;<br><br>&nbsp; {$EXTERNALSYM SunW}<br>&nbsp; SunW = packed record<br>&nbsp; &nbsp; s_w1, s_w2: u_short;<br>&nbsp; end;<br><br>&nbsp; PInAddr = ^TInAddr;<br>&nbsp; {$EXTERNALSYM in_addr}<br>&nbsp; in_addr = record<br>&nbsp; &nbsp; case integer of<br>&nbsp; &nbsp; &nbsp; 0: (S_un_b: SunB);<br>&nbsp; &nbsp; &nbsp; 1: (S_un_w: SunW);<br>&nbsp; &nbsp; &nbsp; 2: (S_addr: u_long);<br>&nbsp; end;<br>&nbsp; TInAddr = in_addr;<br><br>&nbsp; PSockAddrIn = ^TSockAddrIn;<br>&nbsp; {$EXTERNALSYM sockaddr_in}<br>&nbsp; sockaddr_in = record<br>&nbsp; &nbsp; case Integer of<br>&nbsp; &nbsp; &nbsp; 0: (sin_family: u_short;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sin_port: u_short;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sin_addr: TInAddr;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sin_zero: array[0..7] of Char);<br>&nbsp; &nbsp; &nbsp; 1: (sa_family: u_short;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sa_data: array[0..13] of Char)<br>&nbsp; end;<br>&nbsp; TSockAddrIn = sockaddr_in;<br><br>const<br>&nbsp; {$EXTERNALSYM INADDR_ANY}<br>&nbsp; INADDR_ANY &nbsp; &nbsp; &nbsp; = $00000000;<br>&nbsp; {$EXTERNALSYM INADDR_LOOPBACK}<br>&nbsp; INADDR_LOOPBACK &nbsp;= $7F000001;<br>&nbsp; {$EXTERNALSYM INADDR_BROADCAST}<br>&nbsp; INADDR_BROADCAST = -1;<br>&nbsp; {$EXTERNALSYM INADDR_NONE}<br>&nbsp; INADDR_NONE &nbsp; &nbsp; &nbsp;= -1;<br><br>&nbsp; {$EXTERNALSYM WSADESCRIPTION_LEN}<br>&nbsp; WSADESCRIPTION_LEN &nbsp; &nbsp; = &nbsp; 256;<br>&nbsp; {$EXTERNALSYM WSASYS_STATUS_LEN}<br>&nbsp; WSASYS_STATUS_LEN &nbsp; &nbsp; &nbsp;= &nbsp; 128;<br><br>type<br>&nbsp; PWSAData = ^TWSAData;<br>&nbsp; {$EXTERNALSYM WSAData}<br>&nbsp; WSAData = record // !!! also WSDATA<br>&nbsp; &nbsp; wVersion: Word;<br>&nbsp; &nbsp; wHighVersion: Word;<br>&nbsp; &nbsp; szDescription: array[0..WSADESCRIPTION_LEN] of Char;<br>&nbsp; &nbsp; szSystemStatus: array[0..WSASYS_STATUS_LEN] of Char;<br>&nbsp; &nbsp; iMaxSockets: Word;<br>&nbsp; &nbsp; iMaxUdpDg: Word;<br>&nbsp; &nbsp; lpVendorInfo: PChar;<br>&nbsp; end;<br>&nbsp; TWSAData = WSAData;<br><br>&nbsp; {$EXTERNALSYM PTransmitFileBuffers}<br>&nbsp; PTransmitFileBuffers = ^TTransmitFileBuffers;<br>&nbsp; {$EXTERNALSYM _TRANSMIT_FILE_BUFFERS}<br>&nbsp; _TRANSMIT_FILE_BUFFERS = record<br>&nbsp; &nbsp; &nbsp; Head: Pointer;<br>&nbsp; &nbsp; &nbsp; HeadLength: DWORD;<br>&nbsp; &nbsp; &nbsp; Tail: Pointer;<br>&nbsp; &nbsp; &nbsp; TailLength: DWORD;<br>&nbsp; end;<br>&nbsp; {$EXTERNALSYM TTransmitFileBuffers}<br>&nbsp; TTransmitFileBuffers = _TRANSMIT_FILE_BUFFERS;<br>&nbsp; {$EXTERNALSYM TRANSMIT_FILE_BUFFERS}<br>&nbsp; TRANSMIT_FILE_BUFFERS = _TRANSMIT_FILE_BUFFERS;<br><br><br>const<br>&nbsp; {$EXTERNALSYM TF_DISCONNECT}<br>&nbsp; TF_DISCONNECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $01;<br>&nbsp; {$EXTERNALSYM TF_REUSE_SOCKET}<br>&nbsp; TF_REUSE_SOCKET &nbsp; &nbsp; &nbsp; &nbsp; = $02;<br>&nbsp; {$EXTERNALSYM TF_WRITE_BEHIND}<br>&nbsp; TF_WRITE_BEHIND &nbsp; &nbsp; &nbsp; &nbsp; = $04;<br><br>{ Options for use with [gs]etsockopt at the IP level. }<br><br>&nbsp; {$EXTERNALSYM IP_OPTIONS}<br>&nbsp; IP_OPTIONS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp; {$EXTERNALSYM IP_MULTICAST_IF}<br>&nbsp; IP_MULTICAST_IF &nbsp; &nbsp; = 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP multicast interface &nbsp; }<br>&nbsp; {$EXTERNALSYM IP_MULTICAST_TTL}<br>&nbsp; IP_MULTICAST_TTL &nbsp; &nbsp;= 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP multicast timetolive &nbsp;}<br>&nbsp; {$EXTERNALSYM IP_MULTICAST_LOOP}<br>&nbsp; IP_MULTICAST_LOOP &nbsp; = 4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP multicast loopback &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM IP_ADD_MEMBERSHIP}<br>&nbsp; IP_ADD_MEMBERSHIP &nbsp; = 5; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { add &nbsp;an IP group membership &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM IP_DROP_MEMBERSHIP}<br>&nbsp; IP_DROP_MEMBERSHIP &nbsp;= 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { drop an IP group membership &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM IP_TTL}<br>&nbsp; IP_TTL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 7; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP Time To Live &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM IP_TOS}<br>&nbsp; IP_TOS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 8; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP Type Of Service &nbsp; &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM IP_DONTFRAGMENT}<br>&nbsp; IP_DONTFRAGMENT &nbsp; &nbsp; = 9; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP Don't Fragment flag &nbsp; }<br><br><br>&nbsp; {$EXTERNALSYM IP_DEFAULT_MULTICAST_TTL}<br>&nbsp; IP_DEFAULT_MULTICAST_TTL &nbsp; = 1; &nbsp; &nbsp;{ normally limit m'casts to 1 hop &nbsp;}<br>&nbsp; {$EXTERNALSYM IP_DEFAULT_MULTICAST_LOOP}<br>&nbsp; IP_DEFAULT_MULTICAST_LOOP &nbsp;= 1; &nbsp; &nbsp;{ normally hear sends if a member &nbsp;}<br>&nbsp; {$EXTERNALSYM IP_MAX_MEMBERSHIPS}<br>&nbsp; IP_MAX_MEMBERSHIPS &nbsp; &nbsp; &nbsp; &nbsp; = 20; &nbsp; { per socket; must fit in one mbuf }<br><br>{ This is used instead of -1, since the<br>&nbsp; TSocket type is unsigned.}<br><br>&nbsp; {$EXTERNALSYM INVALID_SOCKET &nbsp; &nbsp;=}<br>&nbsp; INVALID_SOCKET &nbsp; &nbsp;= TSocket(NOT(0));<br>&nbsp; {$EXTERNALSYM SOCKET_ERROR &nbsp; &nbsp; &nbsp;=}<br>&nbsp; SOCKET_ERROR &nbsp; &nbsp; &nbsp;= -1;<br><br>{ Types }<br><br>&nbsp; {$EXTERNALSYM SOCK_STREAM}<br>&nbsp; SOCK_STREAM &nbsp; &nbsp; = 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { stream socket }<br>&nbsp; {$EXTERNALSYM SOCK_DGRAM}<br>&nbsp; SOCK_DGRAM &nbsp; &nbsp; &nbsp;= 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { datagram socket }<br>&nbsp; {$EXTERNALSYM SOCK_RAW}<br>&nbsp; SOCK_RAW &nbsp; &nbsp; &nbsp; &nbsp;= 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { raw-protocol interface }<br>&nbsp; {$EXTERNALSYM SOCK_RDM}<br>&nbsp; SOCK_RDM &nbsp; &nbsp; &nbsp; &nbsp;= 4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { reliably-delivered message }<br>&nbsp; {$EXTERNALSYM SOCK_SEQPACKET}<br>&nbsp; SOCK_SEQPACKET &nbsp;= 5; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { sequenced packet stream }<br><br>{ Option flags per-socket. }<br><br>&nbsp; {$EXTERNALSYM SO_DEBUG}<br>&nbsp; SO_DEBUG &nbsp; &nbsp; &nbsp; &nbsp;= $0001; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ turn on debugging info recording }<br>&nbsp; {$EXTERNALSYM SO_ACCEPTCONN}<br>&nbsp; SO_ACCEPTCONN &nbsp; = $0002; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ socket has had listen() }<br>&nbsp; {$EXTERNALSYM SO_REUSEADDR}<br>&nbsp; SO_REUSEADDR &nbsp; &nbsp;= $0004; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ allow local address reuse }<br>&nbsp; {$EXTERNALSYM SO_KEEPALIVE}<br>&nbsp; SO_KEEPALIVE &nbsp; &nbsp;= $0008; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ keep connections alive }<br>&nbsp; {$EXTERNALSYM SO_DONTROUTE}<br>&nbsp; SO_DONTROUTE &nbsp; &nbsp;= $0010; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ just use interface addresses }<br>&nbsp; {$EXTERNALSYM SO_BROADCAST}<br>&nbsp; SO_BROADCAST &nbsp; &nbsp;= $0020; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ permit sending of broadcast msgs }<br>&nbsp; {$EXTERNALSYM SO_USELOOPBACK}<br>&nbsp; SO_USELOOPBACK &nbsp;= $0040; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ bypass hardware when possible }<br>&nbsp; {$EXTERNALSYM SO_LINGER}<br>&nbsp; SO_LINGER &nbsp; &nbsp; &nbsp; = $0080; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ linger on close if data present }<br>&nbsp; {$EXTERNALSYM SO_OOBINLINE}<br>&nbsp; SO_OOBINLINE &nbsp; &nbsp;= $0100; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ leave received OOB data in line }<br><br>&nbsp; {$EXTERNALSYM SO_DONTLINGER}<br>&nbsp; SO_DONTLINGER &nbsp;= &nbsp; $ff7f;<br><br>{ Additional options. }<br><br>&nbsp; {$EXTERNALSYM SO_SNDBUF}<br>&nbsp; SO_SNDBUF &nbsp; &nbsp; &nbsp; = $1001; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ send buffer size }<br>&nbsp; {$EXTERNALSYM SO_RCVBUF}<br>&nbsp; SO_RCVBUF &nbsp; &nbsp; &nbsp; = $1002; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ receive buffer size }<br>&nbsp; {$EXTERNALSYM SO_SNDLOWAT}<br>&nbsp; SO_SNDLOWAT &nbsp; &nbsp; = $1003; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ send low-water mark }<br>&nbsp; {$EXTERNALSYM SO_RCVLOWAT}<br>&nbsp; SO_RCVLOWAT &nbsp; &nbsp; = $1004; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ receive low-water mark }<br>&nbsp; {$EXTERNALSYM SO_SNDTIMEO}<br>&nbsp; SO_SNDTIMEO &nbsp; &nbsp; = $1005; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ send timeout }<br>&nbsp; {$EXTERNALSYM SO_RCVTIMEO}<br>&nbsp; SO_RCVTIMEO &nbsp; &nbsp; = $1006; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ receive timeout }<br>&nbsp; {$EXTERNALSYM SO_ERROR}<br>&nbsp; SO_ERROR &nbsp; &nbsp; &nbsp; &nbsp;= $1007; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ get error status and clear }<br>&nbsp; {$EXTERNALSYM SO_TYPE}<br>&nbsp; SO_TYPE &nbsp; &nbsp; &nbsp; &nbsp; = $1008; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ get socket type }<br><br>{ Options for connect and disconnect data and options. &nbsp;Used only by<br>&nbsp; non-TCP/IP transports such as DECNet, OSI TP4, etc. }<br><br>&nbsp; {$EXTERNALSYM SO_CONNDATA}<br>&nbsp; SO_CONNDATA &nbsp; &nbsp; = $7000;<br>&nbsp; {$EXTERNALSYM SO_CONNOPT}<br>&nbsp; SO_CONNOPT &nbsp; &nbsp; &nbsp;= $7001;<br>&nbsp; {$EXTERNALSYM SO_DISCDATA}<br>&nbsp; SO_DISCDATA &nbsp; &nbsp; = $7002;<br>&nbsp; {$EXTERNALSYM SO_DISCOPT}<br>&nbsp; SO_DISCOPT &nbsp; &nbsp; &nbsp;= $7003;<br>&nbsp; {$EXTERNALSYM SO_CONNDATALEN}<br>&nbsp; SO_CONNDATALEN &nbsp;= $7004;<br>&nbsp; {$EXTERNALSYM SO_CONNOPTLEN}<br>&nbsp; SO_CONNOPTLEN &nbsp; = $7005;<br>&nbsp; {$EXTERNALSYM SO_DISCDATALEN}<br>&nbsp; SO_DISCDATALEN &nbsp;= $7006;<br>&nbsp; {$EXTERNALSYM SO_DISCOPTLEN}<br>&nbsp; SO_DISCOPTLEN &nbsp; = $7007;<br><br>{ Option for opening sockets for synchronous access. }<br><br>&nbsp; {$EXTERNALSYM SO_OPENTYPE}<br>&nbsp; SO_OPENTYPE &nbsp; &nbsp; = $7008;<br><br>&nbsp; {$EXTERNALSYM SO_SYNCHRONOUS_ALERT}<br>&nbsp; SO_SYNCHRONOUS_ALERT &nbsp; &nbsp;= $10;<br>&nbsp; {$EXTERNALSYM SO_SYNCHRONOUS_NONALERT}<br>&nbsp; SO_SYNCHRONOUS_NONALERT = $20;<br><br>{ Other NT-specific options. }<br><br>&nbsp; {$EXTERNALSYM SO_MAXDG}<br>&nbsp; SO_MAXDG &nbsp; &nbsp; &nbsp; &nbsp;= $7009;<br>&nbsp; {$EXTERNALSYM SO_MAXPATHDG}<br>&nbsp; SO_MAXPATHDG &nbsp; &nbsp;= $700A;<br>&nbsp; {$EXTERNALSYM SO_UPDATE_ACCEPT_CONTEXT}<br>&nbsp; SO_UPDATE_ACCEPT_CONTEXT &nbsp; &nbsp; = $700B;<br>&nbsp; {$EXTERNALSYM SO_CONNECT_TIME}<br>&nbsp; SO_CONNECT_TIME = $700C;<br><br>{ TCP options. }<br><br>&nbsp; {$EXTERNALSYM TCP_NODELAY}<br>&nbsp; TCP_NODELAY &nbsp; &nbsp; = $0001;<br>&nbsp; {$EXTERNALSYM TCP_BSDURGENT}<br>&nbsp; TCP_BSDURGENT &nbsp; = $7000;<br><br>{ Address families. }<br><br>&nbsp; {$EXTERNALSYM AF_UNSPEC}<br>&nbsp; AF_UNSPEC &nbsp; &nbsp; &nbsp; = 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { unspecified }<br>&nbsp; {$EXTERNALSYM AF_UNIX}<br>&nbsp; AF_UNIX &nbsp; &nbsp; &nbsp; &nbsp; = 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { local to host (pipes, portals) }<br>&nbsp; {$EXTERNALSYM AF_INET}<br>&nbsp; AF_INET &nbsp; &nbsp; &nbsp; &nbsp; = 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { internetwork: UDP, TCP, etc. }<br>&nbsp; {$EXTERNALSYM AF_IMPLINK}<br>&nbsp; AF_IMPLINK &nbsp; &nbsp; &nbsp;= 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { arpanet imp addresses }<br>&nbsp; {$EXTERNALSYM AF_PUP}<br>&nbsp; AF_PUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { pup protocols: e.g. BSP }<br>&nbsp; {$EXTERNALSYM AF_CHAOS}<br>&nbsp; AF_CHAOS &nbsp; &nbsp; &nbsp; &nbsp;= 5; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { mit CHAOS protocols }<br>&nbsp; {$EXTERNALSYM AF_IPX}<br>&nbsp; AF_IPX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { IPX and SPX }<br>&nbsp; {$EXTERNALSYM AF_NS}<br>&nbsp; AF_NS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { XEROX NS protocols }<br>&nbsp; {$EXTERNALSYM AF_ISO}<br>&nbsp; AF_ISO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 7; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { ISO protocols }<br>&nbsp; {$EXTERNALSYM AF_OSI}<br>&nbsp; AF_OSI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_ISO; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ OSI is ISO }<br>&nbsp; {$EXTERNALSYM AF_ECMA}<br>&nbsp; AF_ECMA &nbsp; &nbsp; &nbsp; &nbsp; = 8; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { european computer manufacturers }<br>&nbsp; {$EXTERNALSYM AF_DATAKIT}<br>&nbsp; AF_DATAKIT &nbsp; &nbsp; &nbsp;= 9; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { datakit protocols }<br>&nbsp; {$EXTERNALSYM AF_CCITT}<br>&nbsp; AF_CCITT &nbsp; &nbsp; &nbsp; &nbsp;= 10; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ CCITT protocols, X.25 etc }<br>&nbsp; {$EXTERNALSYM AF_SNA}<br>&nbsp; AF_SNA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 11; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ IBM SNA }<br>&nbsp; {$EXTERNALSYM AF_DECnet}<br>&nbsp; AF_DECnet &nbsp; &nbsp; &nbsp; = 12; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ DECnet }<br>&nbsp; {$EXTERNALSYM AF_DLI}<br>&nbsp; AF_DLI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 13; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Direct data link interface }<br>&nbsp; {$EXTERNALSYM AF_LAT}<br>&nbsp; AF_LAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 14; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ LAT }<br>&nbsp; {$EXTERNALSYM AF_HYLINK}<br>&nbsp; AF_HYLINK &nbsp; &nbsp; &nbsp; = 15; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ NSC Hyperchannel }<br>&nbsp; {$EXTERNALSYM AF_APPLETALK}<br>&nbsp; AF_APPLETALK &nbsp; &nbsp;= 16; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ AppleTalk }<br>&nbsp; {$EXTERNALSYM AF_NETBIOS}<br>&nbsp; AF_NETBIOS &nbsp; &nbsp; &nbsp;= 17; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ NetBios-style addresses }<br>&nbsp; {$EXTERNALSYM AF_VOICEVIEW}<br>&nbsp; AF_VOICEVIEW &nbsp; &nbsp;= 18; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ VoiceView }<br>&nbsp; {$EXTERNALSYM AF_FIREFOX}<br>&nbsp; AF_FIREFOX &nbsp; &nbsp; &nbsp;= 19; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ FireFox }<br>&nbsp; {$EXTERNALSYM AF_UNKNOWN1}<br>&nbsp; AF_UNKNOWN1 &nbsp; &nbsp; = 20; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Somebody is using this! }<br>&nbsp; {$EXTERNALSYM AF_BAN}<br>&nbsp; AF_BAN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 21; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Banyan }<br><br>&nbsp; {$EXTERNALSYM AF_MAX}<br>&nbsp; AF_MAX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 22;<br><br>type<br>&nbsp; { Structure used by kernel to store most addresses. }<br><br>&nbsp; {$EXTERNALSYM PSOCKADDR}<br>&nbsp; PSOCKADDR = ^TSockAddr;<br>&nbsp; {$EXTERNALSYM TSockAddr}<br>&nbsp; TSockAddr = sockaddr_in;<br><br><br>&nbsp; { Structure used by kernel to pass protocol information in raw sockets. }<br>&nbsp; PSockProto = ^TSockProto;<br>&nbsp; {$EXTERNALSYM sockproto}<br>&nbsp; sockproto = record<br>&nbsp; &nbsp; sp_family: u_short;<br>&nbsp; &nbsp; sp_protocol: u_short;<br>&nbsp; end;<br>&nbsp; TSockProto = sockproto;<br><br>const<br>{ Protocol families, same as address families for now. }<br><br>&nbsp; {$EXTERNALSYM PF_UNSPEC}<br>&nbsp; PF_UNSPEC &nbsp; &nbsp; &nbsp; = AF_UNSPEC;<br>&nbsp; {$EXTERNALSYM PF_UNIX}<br>&nbsp; PF_UNIX &nbsp; &nbsp; &nbsp; &nbsp; = AF_UNIX;<br>&nbsp; {$EXTERNALSYM PF_INET}<br>&nbsp; PF_INET &nbsp; &nbsp; &nbsp; &nbsp; = AF_INET;<br>&nbsp; {$EXTERNALSYM PF_IMPLINK}<br>&nbsp; PF_IMPLINK &nbsp; &nbsp; &nbsp;= AF_IMPLINK;<br>&nbsp; {$EXTERNALSYM PF_PUP}<br>&nbsp; PF_PUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_PUP;<br>&nbsp; {$EXTERNALSYM PF_CHAOS}<br>&nbsp; PF_CHAOS &nbsp; &nbsp; &nbsp; &nbsp;= AF_CHAOS;<br>&nbsp; {$EXTERNALSYM PF_NS}<br>&nbsp; PF_NS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = AF_NS;<br>&nbsp; {$EXTERNALSYM PF_IPX}<br>&nbsp; PF_IPX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_IPX;<br>&nbsp; {$EXTERNALSYM PF_ISO}<br>&nbsp; PF_ISO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_ISO;<br>&nbsp; {$EXTERNALSYM PF_OSI}<br>&nbsp; PF_OSI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_OSI;<br>&nbsp; {$EXTERNALSYM PF_ECMA}<br>&nbsp; PF_ECMA &nbsp; &nbsp; &nbsp; &nbsp; = AF_ECMA;<br>&nbsp; {$EXTERNALSYM PF_DATAKIT}<br>&nbsp; PF_DATAKIT &nbsp; &nbsp; &nbsp;= AF_DATAKIT;<br>&nbsp; {$EXTERNALSYM PF_CCITT}<br>&nbsp; PF_CCITT &nbsp; &nbsp; &nbsp; &nbsp;= AF_CCITT;<br>&nbsp; {$EXTERNALSYM PF_SNA}<br>&nbsp; PF_SNA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_SNA;<br>&nbsp; {$EXTERNALSYM PF_DECnet}<br>&nbsp; PF_DECnet &nbsp; &nbsp; &nbsp; = AF_DECnet;<br>&nbsp; {$EXTERNALSYM PF_DLI}<br>&nbsp; PF_DLI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_DLI;<br>&nbsp; {$EXTERNALSYM PF_LAT}<br>&nbsp; PF_LAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_LAT;<br>&nbsp; {$EXTERNALSYM PF_HYLINK}<br>&nbsp; PF_HYLINK &nbsp; &nbsp; &nbsp; = AF_HYLINK;<br>&nbsp; {$EXTERNALSYM PF_APPLETALK}<br>&nbsp; PF_APPLETALK &nbsp; &nbsp;= AF_APPLETALK;<br>&nbsp; {$EXTERNALSYM PF_VOICEVIEW}<br>&nbsp; PF_VOICEVIEW &nbsp; &nbsp;= AF_VOICEVIEW;<br>&nbsp; {$EXTERNALSYM PF_FIREFOX}<br>&nbsp; PF_FIREFOX &nbsp; &nbsp; &nbsp;= AF_FIREFOX;<br>&nbsp; {$EXTERNALSYM PF_UNKNOWN1}<br>&nbsp; PF_UNKNOWN1 &nbsp; &nbsp; = AF_UNKNOWN1;<br>&nbsp; {$EXTERNALSYM PF_BAN}<br>&nbsp; PF_BAN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_BAN;<br><br>&nbsp; {$EXTERNALSYM PF_MAX}<br>&nbsp; PF_MAX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_MAX;<br><br>type<br>{ Structure used for manipulating linger option. }<br>&nbsp; PLinger = ^TLinger;<br>&nbsp; {$EXTERNALSYM linger}<br>&nbsp; linger = record<br>&nbsp; &nbsp; l_onoff: u_short;<br>&nbsp; &nbsp; l_linger: u_short;<br>&nbsp; end;<br>&nbsp; TLinger = linger;<br><br>const<br>{ Level number for (get/set)sockopt() to apply to socket itself. }<br><br>&nbsp; {$EXTERNALSYM SOL_SOCKET}<br>&nbsp; SOL_SOCKET &nbsp; &nbsp; &nbsp;= $ffff; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{options for socket level }<br><br>{ Maximum queue length specifiable by listen. }<br><br>&nbsp; {$EXTERNALSYM SOMAXCONN}<br>&nbsp; SOMAXCONN &nbsp; &nbsp; &nbsp; = 5;<br><br>&nbsp; {$EXTERNALSYM MSG_OOB}<br>&nbsp; MSG_OOB &nbsp; &nbsp; &nbsp; &nbsp; = $1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {process out-of-band data }<br>&nbsp; {$EXTERNALSYM MSG_PEEK}<br>&nbsp; MSG_PEEK &nbsp; &nbsp; &nbsp; &nbsp;= $2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {peek at incoming message }<br>&nbsp; {$EXTERNALSYM MSG_DONTROUTE}<br>&nbsp; MSG_DONTROUTE &nbsp; = $4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {send without using routing tables }<br><br>&nbsp; {$EXTERNALSYM MSG_MAXIOVLEN}<br>&nbsp; MSG_MAXIOVLEN &nbsp; = 16;<br><br>&nbsp; {$EXTERNALSYM MSG_PARTIAL}<br>&nbsp; MSG_PARTIAL &nbsp; &nbsp; = $8000; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{partial send or recv for message xport }<br><br>{ Define constant based on rfc883, used by gethostbyxxxx() calls. }<br><br>&nbsp; {$EXTERNALSYM MAXGETHOSTSTRUCT}<br>&nbsp; MAXGETHOSTSTRUCT &nbsp; &nbsp; &nbsp; &nbsp;= 1024;<br><br>{ Define flags to be used with the WSAAsyncSelect() call. }<br><br>&nbsp; {$EXTERNALSYM FD_READ}<br>&nbsp; FD_READ &nbsp; &nbsp; &nbsp; &nbsp; = $01;<br>&nbsp; {$EXTERNALSYM FD_WRITE}<br>&nbsp; FD_WRITE &nbsp; &nbsp; &nbsp; &nbsp;= $02;<br>&nbsp; {$EXTERNALSYM FD_OOB}<br>&nbsp; FD_OOB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $04;<br>&nbsp; {$EXTERNALSYM FD_ACCEPT}<br>&nbsp; FD_ACCEPT &nbsp; &nbsp; &nbsp; = $08;<br>&nbsp; {$EXTERNALSYM FD_CONNECT}<br>&nbsp; FD_CONNECT &nbsp; &nbsp; &nbsp;= $10;<br>&nbsp; {$EXTERNALSYM FD_CLOSE}<br>&nbsp; FD_CLOSE &nbsp; &nbsp; &nbsp; &nbsp;= $20;<br><br>{ All Windows Sockets error constants are biased by WSABASEERR from the "normal" }<br><br>&nbsp; {$EXTERNALSYM WSABASEERR}<br>&nbsp; WSABASEERR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 10000;<br><br>{ Windows Sockets definitions of regular Microsoft C error constants }<br><br>&nbsp; {$EXTERNALSYM WSAEINTR}<br>&nbsp; WSAEINTR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+4);<br>&nbsp; {$EXTERNALSYM WSAEBADF}<br>&nbsp; WSAEBADF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+9);<br>&nbsp; {$EXTERNALSYM WSAEACCES}<br>&nbsp; WSAEACCES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+13);<br>&nbsp; {$EXTERNALSYM WSAEFAULT}<br>&nbsp; WSAEFAULT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+14);<br>&nbsp; {$EXTERNALSYM WSAEINVAL}<br>&nbsp; WSAEINVAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+22);<br>&nbsp; {$EXTERNALSYM WSAEMFILE}<br>&nbsp; WSAEMFILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+24);<br><br>{ Windows Sockets definitions of regular Berkeley error constants }<br><br>&nbsp; {$EXTERNALSYM WSAEWOULDBLOCK}<br>&nbsp; WSAEWOULDBLOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+35);<br>&nbsp; {$EXTERNALSYM WSAEINPROGRESS}<br>&nbsp; WSAEINPROGRESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+36);<br>&nbsp; {$EXTERNALSYM WSAEALREADY}<br>&nbsp; WSAEALREADY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+37);<br>&nbsp; {$EXTERNALSYM WSAENOTSOCK}<br>&nbsp; WSAENOTSOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+38);<br>&nbsp; {$EXTERNALSYM WSAEDESTADDRREQ}<br>&nbsp; WSAEDESTADDRREQ &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+39);<br>&nbsp; {$EXTERNALSYM WSAEMSGSIZE}<br>&nbsp; WSAEMSGSIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+40);<br>&nbsp; {$EXTERNALSYM WSAEPROTOTYPE}<br>&nbsp; WSAEPROTOTYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+41);<br>&nbsp; {$EXTERNALSYM WSAENOPROTOOPT}<br>&nbsp; WSAENOPROTOOPT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+42);<br>&nbsp; {$EXTERNALSYM WSAEPROTONOSUPPORT}<br>&nbsp; WSAEPROTONOSUPPORT &nbsp; &nbsp; &nbsp;= (WSABASEERR+43);<br>&nbsp; {$EXTERNALSYM WSAESOCKTNOSUPPORT}<br>&nbsp; WSAESOCKTNOSUPPORT &nbsp; &nbsp; &nbsp;= (WSABASEERR+44);<br>&nbsp; {$EXTERNALSYM WSAEOPNOTSUPP}<br>&nbsp; WSAEOPNOTSUPP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+45);<br>&nbsp; {$EXTERNALSYM WSAEPFNOSUPPORT}<br>&nbsp; WSAEPFNOSUPPORT &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+46);<br>&nbsp; {$EXTERNALSYM WSAEAFNOSUPPORT}<br>&nbsp; WSAEAFNOSUPPORT &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+47);<br>&nbsp; {$EXTERNALSYM WSAEADDRINUSE}<br>&nbsp; WSAEADDRINUSE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+48);<br>&nbsp; {$EXTERNALSYM WSAEADDRNOTAVAIL}<br>&nbsp; WSAEADDRNOTAVAIL &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+49);<br>&nbsp; {$EXTERNALSYM WSAENETDOWN}<br>&nbsp; WSAENETDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+50);<br>&nbsp; {$EXTERNALSYM WSAENETUNREACH}<br>&nbsp; WSAENETUNREACH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+51);<br>&nbsp; {$EXTERNALSYM WSAENETRESET}<br>&nbsp; WSAENETRESET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+52);<br>&nbsp; {$EXTERNALSYM WSAECONNABORTED}<br>&nbsp; WSAECONNABORTED &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+53);<br>&nbsp; {$EXTERNALSYM WSAECONNRESET}<br>&nbsp; WSAECONNRESET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+54);<br>&nbsp; {$EXTERNALSYM WSAENOBUFS}<br>&nbsp; WSAENOBUFS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+55);<br>&nbsp; {$EXTERNALSYM WSAEISCONN}<br>&nbsp; WSAEISCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+56);<br>&nbsp; {$EXTERNALSYM WSAENOTCONN}<br>&nbsp; WSAENOTCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+57);<br>&nbsp; {$EXTERNALSYM WSAESHUTDOWN}<br>&nbsp; WSAESHUTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+58);<br>&nbsp; {$EXTERNALSYM WSAETOOMANYREFS}<br>&nbsp; WSAETOOMANYREFS &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+59);<br>&nbsp; {$EXTERNALSYM WSAETIMEDOUT}<br>&nbsp; WSAETIMEDOUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+60);<br>&nbsp; {$EXTERNALSYM WSAECONNREFUSED}<br>&nbsp; WSAECONNREFUSED &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+61);<br>&nbsp; {$EXTERNALSYM WSAELOOP}<br>&nbsp; WSAELOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+62);<br>&nbsp; {$EXTERNALSYM WSAENAMETOOLONG}<br>&nbsp; WSAENAMETOOLONG &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+63);<br>&nbsp; {$EXTERNALSYM WSAEHOSTDOWN}<br>&nbsp; WSAEHOSTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+64);<br>&nbsp; {$EXTERNALSYM WSAEHOSTUNREACH}<br>&nbsp; WSAEHOSTUNREACH &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+65);<br>&nbsp; {$EXTERNALSYM WSAENOTEMPTY}<br>&nbsp; WSAENOTEMPTY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+66);<br>&nbsp; {$EXTERNALSYM WSAEPROCLIM}<br>&nbsp; WSAEPROCLIM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+67);<br>&nbsp; {$EXTERNALSYM WSAEUSERS}<br>&nbsp; WSAEUSERS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+68);<br>&nbsp; {$EXTERNALSYM WSAEDQUOT}<br>&nbsp; WSAEDQUOT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+69);<br>&nbsp; {$EXTERNALSYM WSAESTALE}<br>&nbsp; WSAESTALE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+70);<br>&nbsp; {$EXTERNALSYM WSAEREMOTE}<br>&nbsp; WSAEREMOTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+71);<br><br>&nbsp; {$EXTERNALSYM WSAEDISCON}<br>&nbsp; WSAEDISCON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+101);<br><br>{ Extended Windows Sockets error constant definitions }<br><br>&nbsp; {$EXTERNALSYM WSASYSNOTREADY}<br>&nbsp; WSASYSNOTREADY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+91);<br>&nbsp; {$EXTERNALSYM WSAVERNOTSUPPORTED}<br>&nbsp; WSAVERNOTSUPPORTED &nbsp; &nbsp; &nbsp;= (WSABASEERR+92);<br>&nbsp; {$EXTERNALSYM WSANOTINITIALISED}<br>&nbsp; WSANOTINITIALISED &nbsp; &nbsp; &nbsp; = (WSABASEERR+93);<br><br>{ Error return codes from gethostbyname() and gethostbyaddr()<br>&nbsp; (when using the resolver). Note that these errors are<br>&nbsp; retrieved via WSAGetLastError() and must therefore follow<br>&nbsp; the rules for avoiding clashes with error numbers from<br>&nbsp; specific implementations or language run-time systems.<br>&nbsp; For this reason the codes are based at WSABASEERR+1001.<br>&nbsp; Note also that [WSA]NO_ADDRESS is defined only for<br>&nbsp; compatibility purposes. }<br><br>{ Authoritative Answer: Host not found }<br><br>&nbsp; {$EXTERNALSYM WSAHOST_NOT_FOUND}<br>&nbsp; WSAHOST_NOT_FOUND &nbsp; &nbsp; &nbsp; = (WSABASEERR+1001);<br>&nbsp; {$EXTERNALSYM HOST_NOT_FOUND}<br>&nbsp; HOST_NOT_FOUND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= WSAHOST_NOT_FOUND;<br><br>{ Non-Authoritative: Host not found, or SERVERFAIL }<br><br>&nbsp; {$EXTERNALSYM WSATRY_AGAIN}<br>&nbsp; WSATRY_AGAIN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+1002);<br>&nbsp; {$EXTERNALSYM TRY_AGAIN}<br>&nbsp; TRY_AGAIN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSATRY_AGAIN;<br><br>{ Non recoverable errors, FORMERR, REFUSED, NOTIMP }<br><br>&nbsp; {$EXTERNALSYM WSANO_RECOVERY}<br>&nbsp; WSANO_RECOVERY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+1003);<br>&nbsp; {$EXTERNALSYM NO_RECOVERY}<br>&nbsp; NO_RECOVERY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSANO_RECOVERY;<br><br>{ Valid name, no data record of requested type }<br><br>&nbsp; {$EXTERNALSYM WSANO_DATA}<br>&nbsp; WSANO_DATA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+1004);<br>&nbsp; {$EXTERNALSYM NO_DATA}<br>&nbsp; NO_DATA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSANO_DATA;<br><br>{ no address, look for MX record }<br><br>&nbsp; {$EXTERNALSYM WSANO_ADDRESS}<br>&nbsp; WSANO_ADDRESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSANO_DATA;<br>&nbsp; {$EXTERNALSYM NO_ADDRESS}<br>&nbsp; NO_ADDRESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= WSANO_ADDRESS;<br><br>{ Windows Sockets errors redefined as regular Berkeley error constants.<br>&nbsp; These are commented out in Windows NT to avoid conflicts with errno.h.<br>&nbsp; Use the WSA constants instead. }<br><br>&nbsp; {$EXTERNALSYM EWOULDBLOCK}<br>&nbsp; EWOULDBLOCK &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEWOULDBLOCK;<br>&nbsp; {$EXTERNALSYM EINPROGRESS}<br>&nbsp; EINPROGRESS &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEINPROGRESS;<br>&nbsp; {$EXTERNALSYM EALREADY}<br>&nbsp; EALREADY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEALREADY;<br>&nbsp; {$EXTERNALSYM ENOTSOCK}<br>&nbsp; ENOTSOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAENOTSOCK;<br>&nbsp; {$EXTERNALSYM EDESTADDRREQ}<br>&nbsp; EDESTADDRREQ &nbsp; &nbsp; &nbsp; = &nbsp;WSAEDESTADDRREQ;<br>&nbsp; {$EXTERNALSYM EMSGSIZE}<br>&nbsp; EMSGSIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEMSGSIZE;<br>&nbsp; {$EXTERNALSYM EPROTOTYPE}<br>&nbsp; EPROTOTYPE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEPROTOTYPE;<br>&nbsp; {$EXTERNALSYM ENOPROTOOPT}<br>&nbsp; ENOPROTOOPT &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENOPROTOOPT;<br>&nbsp; {$EXTERNALSYM EPROTONOSUPPORT}<br>&nbsp; EPROTONOSUPPORT &nbsp; &nbsp;= &nbsp;WSAEPROTONOSUPPORT;<br>&nbsp; {$EXTERNALSYM ESOCKTNOSUPPORT}<br>&nbsp; ESOCKTNOSUPPORT &nbsp; &nbsp;= &nbsp;WSAESOCKTNOSUPPORT;<br>&nbsp; {$EXTERNALSYM EOPNOTSUPP}<br>&nbsp; EOPNOTSUPP &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEOPNOTSUPP;<br>&nbsp; {$EXTERNALSYM EPFNOSUPPORT}<br>&nbsp; EPFNOSUPPORT &nbsp; &nbsp; &nbsp; = &nbsp;WSAEPFNOSUPPORT;<br>&nbsp; {$EXTERNALSYM EAFNOSUPPORT}<br>&nbsp; EAFNOSUPPORT &nbsp; &nbsp; &nbsp; = &nbsp;WSAEAFNOSUPPORT;<br>&nbsp; {$EXTERNALSYM EADDRINUSE}<br>&nbsp; EADDRINUSE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEADDRINUSE;<br>&nbsp; {$EXTERNALSYM EADDRNOTAVAIL}<br>&nbsp; EADDRNOTAVAIL &nbsp; &nbsp; &nbsp;= &nbsp;WSAEADDRNOTAVAIL;<br>&nbsp; {$EXTERNALSYM ENETDOWN}<br>&nbsp; ENETDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAENETDOWN;<br>&nbsp; {$EXTERNALSYM ENETUNREACH}<br>&nbsp; ENETUNREACH &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENETUNREACH;<br>&nbsp; {$EXTERNALSYM ENETRESET}<br>&nbsp; ENETRESET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENETRESET;<br>&nbsp; {$EXTERNALSYM ECONNABORTED}<br>&nbsp; ECONNABORTED &nbsp; &nbsp; &nbsp; = &nbsp;WSAECONNABORTED;<br>&nbsp; {$EXTERNALSYM ECONNRESET}<br>&nbsp; ECONNRESET &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAECONNRESET;<br>&nbsp; {$EXTERNALSYM ENOBUFS}<br>&nbsp; ENOBUFS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENOBUFS;<br>&nbsp; {$EXTERNALSYM EISCONN}<br>&nbsp; EISCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEISCONN;<br>&nbsp; {$EXTERNALSYM ENOTCONN}<br>&nbsp; ENOTCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAENOTCONN;<br>&nbsp; {$EXTERNALSYM ESHUTDOWN}<br>&nbsp; ESHUTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAESHUTDOWN;<br>&nbsp; {$EXTERNALSYM ETOOMANYREFS}<br>&nbsp; ETOOMANYREFS &nbsp; &nbsp; &nbsp; = &nbsp;WSAETOOMANYREFS;<br>&nbsp; {$EXTERNALSYM ETIMEDOUT}<br>&nbsp; ETIMEDOUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAETIMEDOUT;<br>&nbsp; {$EXTERNALSYM ECONNREFUSED}<br>&nbsp; ECONNREFUSED &nbsp; &nbsp; &nbsp; = &nbsp;WSAECONNREFUSED;<br>&nbsp; {$EXTERNALSYM ELOOP}<br>&nbsp; ELOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAELOOP;<br>&nbsp; {$EXTERNALSYM ENAMETOOLONG}<br>&nbsp; ENAMETOOLONG &nbsp; &nbsp; &nbsp; = &nbsp;WSAENAMETOOLONG;<br>&nbsp; {$EXTERNALSYM EHOSTDOWN}<br>&nbsp; EHOSTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEHOSTDOWN;<br>&nbsp; {$EXTERNALSYM EHOSTUNREACH}<br>&nbsp; EHOSTUNREACH &nbsp; &nbsp; &nbsp; = &nbsp;WSAEHOSTUNREACH;<br>&nbsp; {$EXTERNALSYM ENOTEMPTY}<br>&nbsp; ENOTEMPTY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENOTEMPTY;<br>&nbsp; {$EXTERNALSYM EPROCLIM}<br>&nbsp; EPROCLIM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEPROCLIM;<br>&nbsp; {$EXTERNALSYM EUSERS}<br>&nbsp; EUSERS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEUSERS;<br>&nbsp; {$EXTERNALSYM EDQUOT}<br>&nbsp; EDQUOT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEDQUOT;<br>&nbsp; {$EXTERNALSYM ESTALE}<br>&nbsp; ESTALE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAESTALE;<br>&nbsp; {$EXTERNALSYM EREMOTE}<br>&nbsp; EREMOTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEREMOTE;<br><br>type<br>&nbsp; LPVOID = Pointer;<br>&nbsp; PINT = ^Integer;<br>&nbsp; LPINT = PINT;<br><br>&nbsp; SOCKADDR &nbsp; &nbsp;= TSockAddr;<br><br>&nbsp; LPSOCKADDR = ^sockaddr;<br>&nbsp; LPSERVICE_ASYNC_INFO=Pointer;<br><br>&nbsp; SERVICE_ADDRESS=packed record<br>&nbsp; &nbsp; dwAddressType:DWORD;<br>&nbsp; &nbsp; dwAddressFlags:DWORD;<br>&nbsp; &nbsp; dwAddressLength:DWORD;<br>&nbsp; &nbsp; dwPrincipalLength:DWORD;<br>&nbsp; &nbsp; lpAddress:BYTE;<br>&nbsp; &nbsp; lpPrincipal:BYTE;<br>&nbsp; end;<br><br>&nbsp; SERVICE_ADDRESSES=packed record<br>&nbsp; &nbsp; dwAddressCount:DWORD;<br>&nbsp; &nbsp; Addresses:array [1..1] of SERVICE_ADDRESS;<br>&nbsp; end;<br><br>&nbsp; LPSERVICE_ADDRESSES=^SERVICE_ADDRESSES;<br><br>&nbsp; BLOB=packed record<br>&nbsp; &nbsp; cbSize:ULONG;<br>&nbsp; &nbsp; pBlobData:BYTE;<br>&nbsp; end;<br><br>&nbsp; TGUID = packed record<br>&nbsp; &nbsp; D1: LongInt;<br>&nbsp; &nbsp; D2: Word;<br>&nbsp; &nbsp; D3: Word;<br>&nbsp; &nbsp; D4: Array[0..7] of Byte;<br>&nbsp; end;<br>&nbsp; PGUID = ^TGUID;<br>&nbsp; LPGUID = PGUID;<br><br>&nbsp; SERVICE_INFO=packed record<br>&nbsp; &nbsp; lpServiceType:LPGUID;<br>&nbsp; &nbsp; lpServiceName:LPTSTR;<br>&nbsp; &nbsp; lpComment:LPTSTR;<br>&nbsp; &nbsp; lpLocale:LPTSTR;<br>&nbsp; &nbsp; dwDisplayHint:DWORD;<br>&nbsp; &nbsp; dwVersion:DWORD;<br>&nbsp; &nbsp; dwTime:DWORD;<br>&nbsp; &nbsp; lpMachineName:LPTSTR;<br>&nbsp; &nbsp; lpServiceAddress:LPSERVICE_ADDRESSES;<br>&nbsp; &nbsp; ServiceSpecificInfo:BLOB;<br>&nbsp; end;<br><br>&nbsp; LPSERVICE_INFO=^SERVICE_INFO;<br><br>{ Socket function prototypes }<br><br>function EnumProtocolsA(lpiProtocols:LPINT;lpProtocolBuffer:LPVOID;lpdwBufferLength:LPDWORD):integer;stdcall;<br>function EnumProtocolsW(lpiProtocols:LPINT;lpProtocolBuffer:LPVOID;lpdwBufferLength:LPDWORD):integer;stdcall;<br>function GetAddressByNameA(dwNameSpace:DWORD;lpServiceType:LPGUID;lpServiceName:LPTSTR;<br>&nbsp; lpiProtocols:LPINT;dwResolution:DWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;<br>&nbsp; lpCsaddrBuffer:LPVOID;lpdwBufferLength:LPDWORD;lpAliasBuffer:LPTSTR;<br>&nbsp; var lpdwAliasBufferLength:DWORD):integer;stdcall;<br>function GetAddressByNameW(dwNameSpace:DWORD;lpServiceType:LPGUID;lpServiceName:LPTSTR;<br>&nbsp; lpiProtocols:LPINT;dwResolution:DWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;<br>&nbsp; lpCsaddrBuffer:LPVOID;lpdwBufferLength:LPDWORD;lpAliasBuffer:LPTSTR;<br>&nbsp; var lpdwAliasBufferLength:DWORD):integer;stdcall;<br>function GetNameByTypeA(lpServiceType:LPGUID;lpServiceName:LPTSTR;dwNameLength:DWORD):integer;stdcall;<br>function GetNameByTypeW(lpServiceType:LPGUID;lpServiceName:LPTSTR;dwNameLength:DWORD):integer;stdcall;<br>function GetServiceA(dwNameSpace:DWORD;lpGuid:PGUID;lpServiceName:LPTSTR;dwProperties:DWORD;<br>&nbsp; lpBuffer:LPVOID;lpdwBufferSize:LPDWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO):integer;stdcall;<br>function GetServiceW(dwNameSpace:DWORD;lpGuid:PGUID;lpServiceName:LPTSTR;dwProperties:DWORD;<br>&nbsp; lpBuffer:LPVOID;lpdwBufferSize:LPDWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO):integer;stdcall;<br>function GetTypeByNameA(lpServiceName:LPTSTR;lpServiceType:PGUID):integer;stdcall;<br>function GetTypeByNameW(lpServiceName:LPTSTR;lpServiceType:PGUID):integer;stdcall;<br>function MigrateWinsockConfiguration(p,q,r:integer):integer;stdcall;<br>function NPLoadNameSpaces(p,q,r:integer):integer;stdcall;<br>function SetServiceA(dwNameSpace,dwOperation,dwFlags:DWORD;lpServiceInfo:LPSERVICE_INFO;<br>&nbsp; lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;lpdwStatusFlags:LPDWORD):integer;stdcall;<br>function SetServiceW(dwNameSpace,dwOperation,dwFlags:DWORD;lpServiceInfo:LPSERVICE_INFO;<br>&nbsp; lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;lpdwStatusFlags:LPDWORD):integer;stdcall;<br>function dn_expand(a0,a1,a2,a3,a4:integer):integer;stdcall;<br>function inet_network(a0:integer):integer;stdcall;<br>function getnetbyname(a0:integer):integer;stdcall;<br>function rcmd(a0,a1,a2,a3,a4,a5:integer):integer;stdcall;<br>function rexec(a0,a1,a2,a3,a4,a5:integer):integer;stdcall;<br>function rresvport(a0:integer):integer;stdcall;<br>function s_perror(a0,a1:integer):integer;stdcall;<br>function sethostname(a0,a1:integer):integer;stdcall;<br><br><br><br><br>function wep:integer;stdcall;<br>function WSApSetPostRoutine(a0:integer):integer;stdcall;<br><br>{$EXTERNALSYM accept}<br>function accept(s: TSocket; addr: PSockAddr; addrlen: PInteger): TSocket; stdcall;<br>{$EXTERNALSYM bind}<br>function bind(s: TSocket; var addr: TSockAddr; namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM closesocket}<br>function closesocket(s: TSocket): Integer; stdcall;<br>{$EXTERNALSYM connect}<br>function connect(s: TSocket; var name: TSockAddr; namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM ioctlsocket}<br>function ioctlsocket(s: TSocket; cmd: DWORD; var arg: u_long): Integer; stdcall;<br>{$EXTERNALSYM getpeername}<br>function getpeername(s: TSocket; var name: TSockAddr; var namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM getsockname}<br>function getsockname(s: TSocket; var name: TSockAddr; var namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM getsockopt}<br>function getsockopt(s: TSocket; level, optname: Integer; optval: PChar; var optlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM htonl}<br>function htonl(hostlong: u_long): u_long; stdcall;<br>{$EXTERNALSYM htons}<br>function htons(hostshort: u_short): u_short; stdcall;<br>{$EXTERNALSYM inet_addr}<br>function inet_addr(cp: PChar): u_long; stdcall; {PInAddr;} &nbsp;{ TInAddr }<br>{$EXTERNALSYM inet_ntoa}<br>function inet_ntoa(inaddr: TInAddr): PChar; stdcall;<br>{$EXTERNALSYM listen}<br>function listen(s: TSocket; backlog: Integer): Integer; stdcall;<br>{$EXTERNALSYM ntohl}<br>function ntohl(netlong: u_long): u_long; stdcall;<br>{$EXTERNALSYM ntohs}<br>function ntohs(netshort: u_short): u_short; stdcall;<br>{$EXTERNALSYM recv}<br>function recv(s: TSocket; var Buf; len, flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM recvfrom}<br>function recvfrom(s: TSocket; var Buf; len, flags: Integer;<br>&nbsp; var from: TSockAddr; var fromlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM select}<br>function select(nfds: Integer; readfds, writefds, exceptfds: PFDSet;<br>&nbsp; timeout: PTimeVal): Longint; stdcall;<br>{$EXTERNALSYM send}<br>function send(s: TSocket; var Buf; len, flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM sendto}<br>function sendto(s: TSocket; var Buf; len, flags: Integer; var addrto: TSockAddr;<br>&nbsp; tolen: Integer): Integer; stdcall;<br>{$EXTERNALSYM setsockopt}<br>function setsockopt(s: TSocket; level, optname: Integer; optval: PChar;<br>&nbsp; optlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM shutdown}<br>function shutdown(s: TSocket; how: Integer): Integer; stdcall;<br>{$EXTERNALSYM socket}<br>function socket(af, Struct, protocol: Integer): TSocket; stdcall;<br>{$EXTERNALSYM gethostbyaddr}<br>function gethostbyaddr(addr: Pointer; len, Struct: Integer): PHostEnt; stdcall;<br>{$EXTERNALSYM gethostbyname}<br>function gethostbyname(name: PChar): PHostEnt; stdcall;<br>{$EXTERNALSYM gethostname}<br>function gethostname(name: PChar; len: Integer): Integer; stdcall;<br>{$EXTERNALSYM getservbyport}<br>function getservbyport(port: Integer; proto: PChar): PServEnt; stdcall;<br>{$EXTERNALSYM getservbyname}<br>function getservbyname(name, proto: PChar): PServEnt; stdcall;<br>{$EXTERNALSYM getprotobynumber}<br>function getprotobynumber(proto: Integer): PProtoEnt; stdcall;<br>{$EXTERNALSYM getprotobyname}<br>function getprotobyname(name: PChar): PProtoEnt; stdcall;<br>{$EXTERNALSYM WSAStartup}<br>function WSAStartup(wVersionRequired: word; var WSData: TWSAData): Integer; stdcall;<br>{$EXTERNALSYM WSACleanup}<br>function WSACleanup: Integer; stdcall;<br>{$EXTERNALSYM WSASetLastError}<br>procedure WSASetLastError(iError: Integer); stdcall;<br>{$EXTERNALSYM WSAGetLastError}<br>function WSAGetLastError: Integer; stdcall;<br>{$EXTERNALSYM WSAIsBlocking}<br>function WSAIsBlocking: BOOL; stdcall;<br>{$EXTERNALSYM WSAUnhookBlockingHook}<br>function WSAUnhookBlockingHook: Integer; stdcall;<br>{$EXTERNALSYM WSASetBlockingHook}<br>function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc; stdcall;<br>{$EXTERNALSYM WSACancelBlockingCall}<br>function WSACancelBlockingCall: Integer; stdcall;<br>{$EXTERNALSYM WSAAsyncGetServByName}<br>function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int;<br>&nbsp; name, proto, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetServByPort}<br>function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int;<br>&nbsp; proto, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetProtoByName}<br>function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int;<br>&nbsp; name, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetProtoByNumber}<br>function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Integer;<br>&nbsp; buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetHostByName}<br>function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int;<br>&nbsp; name, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetHostByAddr}<br>function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PChar;<br>&nbsp; len, Struct: Integer; buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSACancelAsyncRequest}<br>function WSACancelAsyncRequest(hAsyncTaskHandle: THandle): Integer; stdcall;<br>{$EXTERNALSYM WSAAsyncSelect}<br>function WSAAsyncSelect(s: TSocket; HWindow: HWND; wMsg: u_int; lEvent: Longint): Integer; stdcall;<br>{$EXTERNALSYM WSARecvEx}<br>function WSARecvEx(s: TSocket; var buf; len: Integer; var flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM __WSAFDIsSet}<br>function __WSAFDIsSet(s: TSocket; var FDSet: TFDSet): Bool; stdcall;<br><br>{$EXTERNALSYM TransmitFile}<br>function TransmitFile(hSocket: TSocket; hFile: THandle; nNumberOfBytesToWrite: DWORD;<br>&nbsp; nNumberOfBytesPerSend: DWORD; lpOverlapped: POverlapped;<br>&nbsp; lpTransmitBuffers: PTransmitFileBuffers; dwReserved: DWORD): BOOL; stdcall;<br><br>{$EXTERNALSYM AcceptEx}<br>function AcceptEx(sListenSocket, sAcceptSocket: TSocket;<br>&nbsp; lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength,<br>&nbsp; dwRemoteAddressLength: DWORD; var lpdwBytesReceived: DWORD;<br>&nbsp; lpOverlapped: POverlapped): BOOL; stdcall;<br><br>{$EXTERNALSYM GetAcceptExSockaddrs}<br>procedure GetAcceptExSockaddrs(lpOutputBuffer: Pointer;<br>&nbsp; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD;<br>&nbsp; var LocalSockaddr: TSockAddr; var LocalSockaddrLength: Integer;<br>&nbsp; var RemoteSockaddr: TSockAddr; var RemoteSockaddrLength: Integer); stdcall;<br><br>{$EXTERNALSYM WSAMakeSyncReply}<br>function WSAMakeSyncReply(Buflen, Error: Word): Longint;<br>{$EXTERNALSYM WSAMakeSelectReply}<br>function WSAMakeSelectReply(Event, Error: Word): Longint;<br>{$EXTERNALSYM WSAGetAsyncBuflen}<br>function WSAGetAsyncBuflen(Param: Longint): Word;<br>{$EXTERNALSYM WSAGetAsyncError}<br>function WSAGetAsyncError(Param: Longint): Word;<br>{$EXTERNALSYM WSAGetSelectEvent}<br>function WSAGetSelectEvent(Param: Longint): Word;<br>{$EXTERNALSYM WSAGetSelectError}<br>function WSAGetSelectError(Param: Longint): Word;<br><br>{$EXTERNALSYM FD_CLR}<br>procedure FD_CLR(Socket: TSocket; var FDSet: TFDSet);<br>{$EXTERNALSYM FD_ISSET}<br>function FD_ISSET(Socket: TSocket; var FDSet: TFDSet): Boolean;<br>{$EXTERNALSYM FD_SET}<br>procedure FD_SET(Socket: TSocket; var FDSet: TFDSet); // renamed due to conflict with fd_set (above)<br>{$EXTERNALSYM FD_ZERO}<br>procedure FD_ZERO(var FDSet: TFDSet);<br><br>implementation<br><br>const<br>&nbsp; winsocket = 'wsock32.dll';<br>&nbsp; MSWSOCK='mswsock.dll';<br>&nbsp; WINSOCK32='winsock32.dll'; &nbsp; ///winnt/system32/wsock32.dll<br>&nbsp; WINSOCK2_DLL = 'ws2_32.dll';<br><br><br>function WSAMakeSyncReply;<br>begin<br>&nbsp; WSAMakeSyncReply:= MakeLong(Buflen, Error);<br>end;<br><br>function WSAMakeSelectReply;<br>begin<br>&nbsp; WSAMakeSelectReply:= MakeLong(Event, Error);<br>end;<br><br>function WSAGetAsyncBuflen;<br>begin<br>&nbsp; WSAGetAsyncBuflen:= LOWORD(Param);<br>end;<br><br>function WSAGetAsyncError;<br>begin<br>&nbsp; WSAGetAsyncError:= HIWORD(Param);<br>end;<br><br>function WSAGetSelectEvent;<br>begin<br>&nbsp; WSAGetSelectEvent:= LOWORD(Param);<br>end;<br><br>function WSAGetSelectError;<br>begin<br>&nbsp; WSAGetSelectError:= HIWORD(Param);<br>end;<br><br>procedure FD_CLR(Socket: TSocket; var FDSet: TFDSet);<br>var<br>&nbsp; I: Integer;<br>begin<br>&nbsp; I := 0;<br>&nbsp; while I &lt; FDSet.fd_count do<br>&nbsp; begin<br>&nbsp; &nbsp; if FDSet.fd_array = Socket then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; while I &lt; FDSet.fd_count - 1 do<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; FDSet.fd_array := FDSet.fd_array[I + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp; Inc(I);<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; Dec(FDSet.fd_count);<br>&nbsp; &nbsp; &nbsp; Break;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; Inc(I);<br>&nbsp; end;<br>end;<br><br>function FD_ISSET(Socket: TSocket; var FDSet: TFDSet): Boolean;<br>begin<br>&nbsp; Result := __WSAFDIsSet(Socket, FDSet);<br>end;<br><br>procedure FD_SET(Socket: TSocket; var FDSet: TFDSet);<br>begin<br>&nbsp; if FDSet.fd_count &lt; FD_SETSIZE then<br>&nbsp; begin<br>&nbsp; &nbsp; FDSet.fd_array[FDSet.fd_count] := Socket;<br>&nbsp; &nbsp; Inc(FDSet.fd_count);<br>&nbsp; end;<br>end;<br><br>procedure FD_ZERO(var FDSet: TFDSet);<br>begin<br>&nbsp; FDSet.fd_count := 0;<br>end;<br><br>function EnumProtocolsA; external MSWSOCK name 'enumprotocolsa';<br>function EnumProtocolsW; external MSWSOCK name 'enumprotocolsw';<br>function GetAddressByNameA; external MSWSOCK name 'getaddressbynamea';<br>function GetAddressByNameW; external MSWSOCK name 'getaddressbynamew';<br>function GetNameByTypeA; external MSWSOCK name 'getnamebytypea';<br>function GetNameByTypeW; external MSWSOCK name 'getnamebytypew';<br>function GetServiceA; external MSWSOCK name 'getservicea';<br>function GetServiceW; external MSWSOCK name 'getservicew';<br>function GetTypeByNameA; external MSWSOCK name 'gettypebynamea';<br>function GetTypeByNameW; external MSWSOCK name 'gettypebynamew';<br>function MigrateWinsockConfiguration; external MSWSOCK name 'migratewinsockconfiguration';<br>function NPLoadNameSpaces; external MSWSOCK name 'nploadnamespaces';<br>function SetServiceA; external MSWSOCK name 'setservicea';<br>function SetServiceW; external MSWSOCK name 'setservicew';<br>function dn_expand; external MSWSOCK name 'dn_expand';<br>function inet_network; external MSWSOCK name 'inet_network';<br>function getnetbyname; external MSWSOCK name 'getnetbyname';<br>function rcmd; external MSWSOCK name 'rcmd';<br>function rexec; external MSWSOCK name 'rexec';<br>function rresvport; external MSWSOCK name 'rresvport';<br>function s_perror; external MSWSOCK name 's_perror';<br>function sethostname; external MSWSOCK name 'sethostname';<br><br>function WEP; external WINSOCK2_Dll name 'wep';<br>function WSApSetPostRoutine; external WINSOCK2_Dll name 'wsapsetpostroutine';<br><br>function accept; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'accept';<br>function bind; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'bind';<br>function closesocket; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'closesocket';<br>function connect; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'connect';<br>function getpeername; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getpeername';<br>function getsockname; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getsockname';<br>function getsockopt; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'getsockopt';<br>function htonl; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'htonl';<br>function htons; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'htons';<br>function inet_addr; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'inet_addr';<br>function inet_ntoa; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'inet_ntoa';<br>function ioctlsocket; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'ioctlsocket';<br>function listen; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'listen';<br>function ntohl; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'ntohl';<br>function ntohs; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'ntohs';<br>function recv; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'recv';<br>function recvfrom; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'recvfrom';<br>function select; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'select';<br>function send; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'send';<br>function sendto; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'sendto';<br>function setsockopt; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'setsockopt';<br>function shutdown; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'shutdown';<br>function socket; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'socket';<br><br>function gethostbyaddr; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'gethostbyaddr';<br>function gethostbyname; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'gethostbyname';<br>function getprotobyname; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'getprotobyname';<br>function getprotobynumber; &nbsp;external &nbsp; &nbsp;winsocket name 'getprotobynumber';<br>function getservbyname; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getservbyname';<br>function getservbyport; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getservbyport';<br>function gethostname; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'gethostname';<br><br>function WSAAsyncSelect; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'WSAAsyncSelect';<br>function WSARecvEx; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'WSARecvEx';<br>function WSAAsyncGetHostByAddr; external winsocket name 'WSAAsyncGetHostByAddr';<br>function WSAAsyncGetHostByName; external winsocket name 'WSAAsyncGetHostByName';<br>function WSAAsyncGetProtoByNumber; external winsocket name 'WSAAsyncGetProtoByNumber';<br>function WSAAsyncGetProtoByName; external winsocket name 'WSAAsyncGetProtoByName';<br>function WSAAsyncGetServByPort; external winsocket name 'WSAAsyncGetServByPort';<br>function WSAAsyncGetServByName; external winsocket name 'WSAAsyncGetServByName';<br>function WSACancelAsyncRequest; external winsocket name 'WSACancelAsyncRequest';<br>function WSASetBlockingHook; external &nbsp; &nbsp;winsocket name 'WSASetBlockingHook';<br>function WSAUnhookBlockingHook; external winsocket name 'WSAUnhookBlockingHook';<br>function WSAGetLastError; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'WSAGetLastError';<br>procedure WSASetLastError; &nbsp; external &nbsp; &nbsp;winsocket name 'WSASetLastError';<br>function WSACancelBlockingCall; external winsocket name 'WSACancelBlockingCall';<br>function WSAIsBlocking; &nbsp; &nbsp; external &nbsp; &nbsp; winsocket name 'WSAIsBlocking';<br>function WSAStartup; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'WSAStartup';<br>function WSACleanup; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'WSACleanup';<br>function __WSAFDIsSet; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name '__WSAFDIsSet';<br><br>function TransmitFile; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'TransmitFile';<br>function AcceptEx; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'AcceptEx';<br>procedure GetAcceptExSockaddrs; &nbsp;external &nbsp; &nbsp;winsocket name 'GetAcceptExSockaddrs';<br><br>end.<br><br>
 
直接用Delphi7中带的IdWinSock2.pas稍微改一下就行了。
 
to:superatom<br>用IdWinSock2.pas一样出下面的错:the procedure entry point wsastartup could not be located in the dynamic link library wsock32.dll
 
library wsock32;<br><br>uses<br>&nbsp;WinSock in 'WinSock.pas';<br><br>exports<br>AcceptEx &nbsp;index &nbsp;1141 &nbsp;,// &nbsp;MSWSOCK.AcceptEx<br>EnumProtocolsA &nbsp;index &nbsp;1111 &nbsp;,// &nbsp;MSWSOCK.EnumProtocolsA<br>EnumProtocolsW &nbsp;index &nbsp;1112 &nbsp;,// &nbsp;MSWSOCK.EnumProtocolsW<br>GetAcceptExSockaddrs &nbsp;index &nbsp;1142 &nbsp;,// &nbsp;MSWSOCK.GetAcceptExSockaddrs<br>GetAddressByNameA &nbsp;index &nbsp;1109 &nbsp;,// &nbsp;MSWSOCK.GetAddressByNameA<br>GetAddressByNameW &nbsp;index &nbsp;1110 &nbsp;,// &nbsp;MSWSOCK.GetAddressByNameW<br>GetNameByTypeA &nbsp;index &nbsp;1115 &nbsp;,// &nbsp;MSWSOCK.GetNameByTypeA<br>GetNameByTypeW &nbsp;index &nbsp;1116 &nbsp;,// &nbsp;MSWSOCK.GetNameByTypeW<br>GetServiceA &nbsp;index &nbsp;1119 &nbsp;,// &nbsp;MSWSOCK.GetServiceA<br>GetServiceW &nbsp;index &nbsp;1120 &nbsp;,// &nbsp;MSWSOCK.GetServiceW<br>GetTypeByNameA &nbsp;index &nbsp;1113 &nbsp;,// &nbsp;MSWSOCK.GetTypeByNameA<br>GetTypeByNameW &nbsp;index &nbsp;1114 &nbsp;,// &nbsp;MSWSOCK.GetTypeByNameW<br>MigrateWinsockConfiguration &nbsp;index &nbsp;24 &nbsp;,// &nbsp;MSWSOCK.MigrateWinsockConfiguration<br>NPLoadNameSpaces &nbsp;index &nbsp;1130 &nbsp;,// &nbsp;MSWSOCK.NPLoadNameSpaces<br>SetServiceA &nbsp;index &nbsp;1117 &nbsp;,// &nbsp;MSWSOCK.SetServiceA<br>SetServiceW &nbsp;index &nbsp;1118 &nbsp;,// &nbsp;MSWSOCK.SetServiceW<br>TransmitFile &nbsp;index &nbsp;1140 &nbsp;,// &nbsp;MSWSOCK.TransmitFile<br>WSARecvEx &nbsp;index &nbsp;1107 &nbsp;,// &nbsp;MSWSOCK.WSARecvEx<br>dn_expand &nbsp;index &nbsp;1106 &nbsp;,// &nbsp;MSWSOCK.dn_expand<br>inet_network &nbsp;index &nbsp;1100 &nbsp;,// &nbsp;MSWSOCK.inet_network<br>getnetbyname &nbsp;index &nbsp;1101 &nbsp;,// &nbsp;MSWSOCK.getnetbyname<br>rcmd &nbsp;index &nbsp;1102 &nbsp;,// &nbsp;MSWSOCK.rcmd<br>rexec &nbsp;index &nbsp;1103 &nbsp;,// &nbsp;MSWSOCK.rexec<br>rresvport &nbsp;index &nbsp;1104 &nbsp;,// &nbsp;MSWSOCK.rresvport<br>s_perror &nbsp;index &nbsp;1108 &nbsp;,// &nbsp;MSWSOCK.s_perror<br>sethostname &nbsp;index &nbsp;1105 &nbsp;,// &nbsp;MSWSOCK.sethostname<br><br>WEP &nbsp;index &nbsp;500 &nbsp;,// &nbsp;ws2_32.WEP<br>WSAAsyncGetHostByAddr &nbsp;index &nbsp;102 &nbsp;,// &nbsp;ws2_32.WSAAsyncGetHostByAddr<br>WSAAsyncGetHostByName &nbsp;index &nbsp;103 &nbsp;,// &nbsp;ws2_32.WSAAsyncGetHostByName<br>WSAAsyncGetProtoByName &nbsp;index &nbsp;105 &nbsp;,// &nbsp;ws2_32.WSAAsyncGetProtoByName<br>WSAAsyncGetProtoByNumber &nbsp;index &nbsp;104 &nbsp;,// &nbsp;ws2_32.WSAAsyncGetProtoByNumber<br>WSAAsyncGetServByName &nbsp;index &nbsp;107 &nbsp;,// &nbsp;ws2_32.WSAAsyncGetServByName<br>WSAAsyncGetServByPort &nbsp;index &nbsp;106 &nbsp;,// &nbsp;ws2_32.WSAAsyncGetServByPort<br>WSAAsyncSelect &nbsp;index &nbsp;101 &nbsp;,// &nbsp;ws2_32.WSAAsyncSelect<br>WSACancelAsyncRequest &nbsp;index &nbsp;108 &nbsp;,// &nbsp;ws2_32.WSACancelAsyncRequest<br>WSACancelBlockingCall &nbsp;index &nbsp;113 &nbsp;,// &nbsp;ws2_32.WSACancelBlockingCall<br>WSACleanup &nbsp;index &nbsp;116 &nbsp;,// &nbsp;ws2_32.WSACleanup<br>WSAGetLastError &nbsp;index &nbsp;111 &nbsp;,// &nbsp;ws2_32.WSAGetLastError<br>WSAIsBlocking &nbsp;index &nbsp;114 &nbsp;,// &nbsp;ws2_32.WSAIsBlocking<br>WSASetBlockingHook &nbsp;index &nbsp;109 &nbsp;,// &nbsp;ws2_32.WSASetBlockingHook<br>WSASetLastError &nbsp;index &nbsp;112 &nbsp;,// &nbsp;ws2_32.WSASetLastError<br>WSAStartup &nbsp;index &nbsp;115 &nbsp;,// &nbsp;ws2_32.WSAStartup<br>WSAUnhookBlockingHook &nbsp;index &nbsp;110 &nbsp;,// &nbsp;ws2_32.WSAUnhookBlockingHook<br>WSApSetPostRoutine &nbsp;index &nbsp;1000 &nbsp;,// &nbsp;ws2_32.WSApSetPostRoutine<br>__WSAFDIsSet &nbsp;index &nbsp;151 &nbsp;,// &nbsp;ws2_32.__WSAFDIsSet<br>accept &nbsp;index &nbsp;1 &nbsp;,// &nbsp;ws2_32.accept<br>bind &nbsp;index &nbsp;2 &nbsp;,// &nbsp;ws2_32.bind<br>closesocket &nbsp;index &nbsp;3 &nbsp;,// &nbsp;ws2_32.closesocket<br>connect &nbsp;index &nbsp;4 &nbsp;,// &nbsp;ws2_32.connect<br>gethostbyaddr &nbsp;index &nbsp;51 &nbsp;,// &nbsp;ws2_32.gethostbyaddr<br>gethostbyname &nbsp;index &nbsp;52 &nbsp;,// &nbsp;ws2_32.gethostbyname<br>gethostname &nbsp;index &nbsp;57 &nbsp;,// &nbsp;ws2_32.gethostname<br>getpeername &nbsp;index &nbsp;5 &nbsp;,// &nbsp;ws2_32.getpeername<br>getprotobyname &nbsp;index &nbsp;53 &nbsp;,// &nbsp;ws2_32.getprotobyname<br>getprotobynumber &nbsp;index &nbsp;54 &nbsp;,// &nbsp;ws2_32.getprotobynumber<br>getservbyname &nbsp;index &nbsp;55 &nbsp;,// &nbsp;ws2_32.getservbyname<br>getservbyport &nbsp;index &nbsp;56 &nbsp;,// &nbsp;ws2_32.getservbyport<br>getsockname &nbsp;index &nbsp;6 &nbsp;,// &nbsp;ws2_32.getsockname<br>getsockopt &nbsp;index &nbsp;7 &nbsp;,//<br>htonl &nbsp;index &nbsp;8 &nbsp;,// &nbsp;ws2_32.htonl<br>htons &nbsp;index &nbsp;9 &nbsp;,// &nbsp;ws2_32.htons<br>inet_addr &nbsp;index &nbsp;10 &nbsp;,// &nbsp;ws2_32.inet_addr<br>inet_ntoa &nbsp;index &nbsp;11 &nbsp;,// &nbsp;ws2_32.inet_ntoa<br>ioctlsocket &nbsp;index &nbsp;12 &nbsp;,// &nbsp;ws2_32.ioctlsocket<br>listen &nbsp;index &nbsp;13 &nbsp;,// &nbsp;ws2_32.listen<br>ntohl &nbsp;index &nbsp;14 &nbsp;,// &nbsp;ws2_32.ntohl<br>ntohs &nbsp;index &nbsp;15 &nbsp;,// &nbsp;ws2_32.ntohs<br>select &nbsp;index &nbsp;18 &nbsp;,// &nbsp;ws2_32.select<br>send &nbsp;index &nbsp;19 &nbsp;,// &nbsp;ws2_32.send<br>sendto &nbsp;index &nbsp;20 &nbsp;,// &nbsp;ws2_32.sendto<br>setsockopt &nbsp;index &nbsp;21 &nbsp;,//<br>shutdown &nbsp;index &nbsp;22 &nbsp;,// &nbsp;ws2_32.shutdown<br>socket &nbsp;index &nbsp;23, &nbsp;// &nbsp;ws2_32.socket<br><br>recv &nbsp;index &nbsp;16 &nbsp;,//<br>recvfrom &nbsp;index &nbsp;17 &nbsp;;//<br>{$R *.RES}<br><br>begin<br>end.<br><br>{ *********************************************************************** }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ Delphi Runtime Library &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ Copyright (c) 1996-2001 Borland Software Corporation &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ *********************************************************************** }<br><br>{*******************************************************}<br>{ &nbsp; &nbsp; &nbsp; Win32 sockets API Interface Unit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{*******************************************************}<br><br>unit WinSock;<br><br>{$WEAKPACKAGEUNIT}<br><br>interface<br><br>uses Windows;<br><br>{ HPPEMIT '#include &lt;windows.h&gt;'}<br><br>type<br>&nbsp;{$EXTERNALSYM u_char}<br>&nbsp;u_char = Char;<br>&nbsp;{$EXTERNALSYM u_short}<br>&nbsp;u_short = Word;<br>&nbsp;{$EXTERNALSYM u_int}<br>&nbsp;u_int = Integer;<br>&nbsp;{$EXTERNALSYM u_long}<br>&nbsp;u_long = Longint;<br><br>{ The new type to be used in all<br>&nbsp;instances which refer to sockets. }<br>&nbsp;{$EXTERNALSYM TSocket}<br>&nbsp;TSocket = u_int;<br><br>const<br>&nbsp;{$EXTERNALSYM FD_SETSIZE}<br>&nbsp;FD_SETSIZE &nbsp; &nbsp; = &nbsp; 64;<br><br>// WinSock 2 extension -- manifest constants for shutdown()<br>&nbsp;{$EXTERNALSYM SD_RECEIVE}<br>&nbsp;SD_RECEIVE &nbsp; &nbsp; = 0;<br>&nbsp;{$EXTERNALSYM SD_SEND}<br>&nbsp;SD_SEND &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp;{$EXTERNALSYM SD_BOTH}<br>&nbsp;SD_BOTH &nbsp; &nbsp; &nbsp; &nbsp;= 2;<br><br>type<br>// the following emits are a workaround to the name conflict with<br>// procedure FD_SET and struct fd_set in winsock.h<br>(*$HPPEMIT '#include &lt;winsock.h&gt;'*)<br>(*$HPPEMIT 'namespace Winsock'*)<br>(*$HPPEMIT '{'*)<br>(*$HPPEMIT 'typedef fd_set *PFDSet;'*) // due to name conflict with procedure FD_SET<br>(*$HPPEMIT 'typedef fd_set TFDSet;'*) &nbsp;// due to name conflict with procedure FD_SET<br>(*$HPPEMIT '}'*)<br><br>&nbsp;{$NODEFINE PFDSet}<br>&nbsp;PFDSet = ^TFDSet;<br>&nbsp;{$NODEFINE TFDSet}<br>&nbsp;TFDSet = record<br>&nbsp; &nbsp;fd_count: u_int;<br>&nbsp; &nbsp;fd_array: array[0..FD_SETSIZE-1] of TSocket;<br>&nbsp;end;<br><br>&nbsp;PTimeVal = ^TTimeVal;<br>&nbsp;{$EXTERNALSYM timeval}<br>&nbsp;timeval = record<br>&nbsp; &nbsp;tv_sec: Longint;<br>&nbsp; &nbsp;tv_usec: Longint;<br>&nbsp;end;<br>&nbsp;TTimeVal = timeval;<br><br>const<br>&nbsp;{$EXTERNALSYM IOCPARM_MASK}<br>&nbsp;IOCPARM_MASK = $7f;<br>&nbsp;{$EXTERNALSYM IOC_VOID}<br>&nbsp;IOC_VOID &nbsp; &nbsp; = $20000000;<br>&nbsp;{$EXTERNALSYM IOC_OUT}<br>&nbsp;IOC_OUT &nbsp; &nbsp; &nbsp;= $40000000;<br>&nbsp;{$EXTERNALSYM IOC_IN}<br>&nbsp;IOC_IN &nbsp; &nbsp; &nbsp; = $80000000;<br>&nbsp;{$EXTERNALSYM IOC_INOUT}<br>&nbsp;IOC_INOUT &nbsp; &nbsp;= (IOC_IN or IOC_OUT);<br><br>&nbsp;{$EXTERNALSYM FIONREAD}<br>&nbsp;FIONREAD &nbsp; &nbsp; = IOC_OUT or { get # bytes to read }<br>&nbsp; &nbsp;((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or<br>&nbsp; &nbsp;(Longint(Byte('f')) shl 8) or 127;<br>&nbsp;{$EXTERNALSYM FIONBIO}<br>&nbsp;FIONBIO &nbsp; &nbsp; &nbsp;= IOC_IN or { set/clear non-blocking i/o }<br>&nbsp; &nbsp;((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or<br>&nbsp; &nbsp;(Longint(Byte('f')) shl 8) or 126;<br>&nbsp;{$EXTERNALSYM FIOASYNC}<br>&nbsp;FIOASYNC &nbsp; &nbsp; = IOC_IN or { set/clear async i/o }<br>&nbsp; &nbsp;((Longint(SizeOf(Longint)) and IOCPARM_MASK) shl 16) or<br>&nbsp; &nbsp;(Longint(Byte('f')) shl 8) or 125;<br><br>type<br>&nbsp;PHostEnt = ^THostEnt;<br>&nbsp;{$EXTERNALSYM hostent}<br>&nbsp;hostent = record<br>&nbsp; &nbsp;h_name: PChar;<br>&nbsp; &nbsp;h_aliases: ^PChar;<br>&nbsp; &nbsp;h_addrtype: Smallint;<br>&nbsp; &nbsp;h_length: Smallint;<br>&nbsp; &nbsp;case Byte of<br>&nbsp; &nbsp; &nbsp;0: (h_addr_list: ^PChar);<br>&nbsp; &nbsp; &nbsp;1: (h_addr: ^PChar)<br>&nbsp;end;<br>&nbsp;THostEnt = hostent;<br><br>&nbsp;PNetEnt = ^TNetEnt;<br>&nbsp;{$EXTERNALSYM netent}<br>&nbsp;netent = record<br>&nbsp; &nbsp;n_name: PChar;<br>&nbsp; &nbsp;n_aliases: ^PChar;<br>&nbsp; &nbsp;n_addrtype: Smallint;<br>&nbsp; &nbsp;n_net: u_long;<br>&nbsp;end;<br>&nbsp;TNetEnt = netent;<br><br>&nbsp;PServEnt = ^TServEnt;<br>&nbsp;{$EXTERNALSYM servent}<br>&nbsp;servent = record<br>&nbsp; &nbsp;s_name: PChar;<br>&nbsp; &nbsp;s_aliases: ^PChar;<br>&nbsp; &nbsp;s_port: Word;<br>&nbsp; &nbsp;s_proto: PChar;<br>&nbsp;end;<br>&nbsp;TServEnt = servent;<br><br>&nbsp;PProtoEnt = ^TProtoEnt;<br>&nbsp;{$EXTERNALSYM protoent}<br>&nbsp;protoent = record<br>&nbsp; &nbsp;p_name: PChar;<br>&nbsp; &nbsp;p_aliases: ^Pchar;<br>&nbsp; &nbsp;p_proto: Smallint;<br>&nbsp;end;<br>&nbsp;TProtoEnt = protoent;<br><br>const<br><br>{ Protocols }<br><br>&nbsp;{$EXTERNALSYM IPPROTO_IP}<br>&nbsp;IPPROTO_IP &nbsp; &nbsp; = &nbsp; 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { dummy for IP }<br>&nbsp;{$EXTERNALSYM IPPROTO_ICMP}<br>&nbsp;IPPROTO_ICMP &nbsp; = &nbsp; 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { control message protocol }<br>&nbsp;{$EXTERNALSYM IPPROTO_IGMP}<br>&nbsp;IPPROTO_IGMP &nbsp; = &nbsp; 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { group management protocol }<br>&nbsp;{$EXTERNALSYM IPPROTO_GGP}<br>&nbsp;IPPROTO_GGP &nbsp; &nbsp;= &nbsp; 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { gateway^2 (deprecated) }<br>&nbsp;{$EXTERNALSYM IPPROTO_TCP}<br>&nbsp;IPPROTO_TCP &nbsp; &nbsp;= &nbsp; 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { tcp }<br>&nbsp;{$EXTERNALSYM IPPROTO_PUP}<br>&nbsp;IPPROTO_PUP &nbsp; &nbsp;= &nbsp;12; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { pup }<br>&nbsp;{$EXTERNALSYM IPPROTO_UDP}<br>&nbsp;IPPROTO_UDP &nbsp; &nbsp;= &nbsp;17; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { user datagram protocol }<br>&nbsp;{$EXTERNALSYM IPPROTO_IDP}<br>&nbsp;IPPROTO_IDP &nbsp; &nbsp;= &nbsp;22; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { xns idp }<br>&nbsp;{$EXTERNALSYM IPPROTO_ND}<br>&nbsp;IPPROTO_ND &nbsp; &nbsp; = &nbsp;77; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { UNOFFICIAL net disk proto }<br><br>&nbsp;{$EXTERNALSYM IPPROTO_RAW}<br>&nbsp;IPPROTO_RAW &nbsp; &nbsp;= &nbsp;255; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ raw IP packet }<br>&nbsp;{$EXTERNALSYM IPPROTO_MAX}<br>&nbsp;IPPROTO_MAX &nbsp; &nbsp;= &nbsp;256;<br><br>{ Port/socket numbers: network standard functions}<br><br>&nbsp;{$EXTERNALSYM IPPORT_ECHO}<br>&nbsp;IPPORT_ECHO &nbsp; &nbsp;= &nbsp; 7;<br>&nbsp;{$EXTERNALSYM IPPORT_DISCARD}<br>&nbsp;IPPORT_DISCARD = &nbsp; 9;<br>&nbsp;{$EXTERNALSYM IPPORT_SYSTAT}<br>&nbsp;IPPORT_SYSTAT &nbsp;= &nbsp; 11;<br>&nbsp;{$EXTERNALSYM IPPORT_DAYTIME}<br>&nbsp;IPPORT_DAYTIME = &nbsp; 13;<br>&nbsp;{$EXTERNALSYM IPPORT_NETSTAT}<br>&nbsp;IPPORT_NETSTAT = &nbsp; 15;<br>&nbsp;{$EXTERNALSYM IPPORT_FTP}<br>&nbsp;IPPORT_FTP &nbsp; &nbsp; = &nbsp; 21;<br>&nbsp;{$EXTERNALSYM IPPORT_TELNET}<br>&nbsp;IPPORT_TELNET &nbsp;= &nbsp; 23;<br>&nbsp;{$EXTERNALSYM IPPORT_SMTP}<br>&nbsp;IPPORT_SMTP &nbsp; &nbsp;= &nbsp; 25;<br>&nbsp;{$EXTERNALSYM IPPORT_TIMESERVER}<br>&nbsp;IPPORT_TIMESERVER &nbsp;= &nbsp;37;<br>&nbsp;{$EXTERNALSYM IPPORT_NAMESERVER}<br>&nbsp;IPPORT_NAMESERVER &nbsp;= &nbsp;42;<br>&nbsp;{$EXTERNALSYM IPPORT_WHOIS}<br>&nbsp;IPPORT_WHOIS &nbsp; &nbsp; &nbsp; = &nbsp;43;<br>&nbsp;{$EXTERNALSYM IPPORT_MTP}<br>&nbsp;IPPORT_MTP &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;57;<br><br>{ Port/socket numbers: host specific functions }<br><br>&nbsp;{$EXTERNALSYM IPPORT_TFTP}<br>&nbsp;IPPORT_TFTP &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;69;<br>&nbsp;{$EXTERNALSYM IPPORT_RJE}<br>&nbsp;IPPORT_RJE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;77;<br>&nbsp;{$EXTERNALSYM IPPORT_FINGER}<br>&nbsp;IPPORT_FINGER &nbsp; &nbsp; &nbsp;= &nbsp;79;<br>&nbsp;{$EXTERNALSYM IPPORT_TTYLINK}<br>&nbsp;IPPORT_TTYLINK &nbsp; &nbsp; = &nbsp;87;<br>&nbsp;{$EXTERNALSYM IPPORT_SUPDUP}<br>&nbsp;IPPORT_SUPDUP &nbsp; &nbsp; &nbsp;= &nbsp;95;<br><br>{ UNIX TCP sockets }<br><br>&nbsp;{$EXTERNALSYM IPPORT_EXECSERVER}<br>&nbsp;IPPORT_EXECSERVER &nbsp;= &nbsp;512;<br>&nbsp;{$EXTERNALSYM IPPORT_LOGINSERVER}<br>&nbsp;IPPORT_LOGINSERVER = &nbsp;513;<br>&nbsp;{$EXTERNALSYM IPPORT_CMDSERVER}<br>&nbsp;IPPORT_CMDSERVER &nbsp; = &nbsp;514;<br>&nbsp;{$EXTERNALSYM IPPORT_EFSSERVER}<br>&nbsp;IPPORT_EFSSERVER &nbsp; = &nbsp;520;<br><br>{ UNIX UDP sockets }<br><br>&nbsp;{$EXTERNALSYM IPPORT_BIFFUDP}<br>&nbsp;IPPORT_BIFFUDP &nbsp; &nbsp; = &nbsp;512;<br>&nbsp;{$EXTERNALSYM IPPORT_WHOSERVER}<br>&nbsp;IPPORT_WHOSERVER &nbsp; = &nbsp;513;<br>&nbsp;{$EXTERNALSYM IPPORT_ROUTESERVER}<br>&nbsp;IPPORT_ROUTESERVER = &nbsp;520;<br><br>{ Ports &lt; IPPORT_RESERVED are reserved for<br>&nbsp;privileged processes (e.g. root). }<br><br>&nbsp;{$EXTERNALSYM IPPORT_RESERVED}<br>&nbsp;IPPORT_RESERVED &nbsp; &nbsp;= &nbsp;1024;<br><br>{ Link numbers }<br><br>&nbsp;{$EXTERNALSYM IMPLINK_IP}<br>&nbsp;IMPLINK_IP &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;155;<br>&nbsp;{$EXTERNALSYM IMPLINK_LOWEXPER}<br>&nbsp;IMPLINK_LOWEXPER &nbsp; = &nbsp;156;<br>&nbsp;{$EXTERNALSYM IMPLINK_HIGHEXPER}<br>&nbsp;IMPLINK_HIGHEXPER &nbsp;= &nbsp;158;<br><br>type<br>&nbsp;{$EXTERNALSYM SunB}<br>&nbsp;SunB = packed record<br>&nbsp; &nbsp;s_b1, s_b2, s_b3, s_b4: u_char;<br>&nbsp;end;<br><br>&nbsp;{$EXTERNALSYM SunW}<br>&nbsp;SunW = packed record<br>&nbsp; &nbsp;s_w1, s_w2: u_short;<br>&nbsp;end;<br><br>&nbsp;PInAddr = ^TInAddr;<br>&nbsp;{$EXTERNALSYM in_addr}<br>&nbsp;in_addr = record<br>&nbsp; &nbsp;case integer of<br>&nbsp; &nbsp; &nbsp;0: (S_un_b: SunB);<br>&nbsp; &nbsp; &nbsp;1: (S_un_w: SunW);<br>&nbsp; &nbsp; &nbsp;2: (S_addr: u_long);<br>&nbsp;end;<br>&nbsp;TInAddr = in_addr;<br><br>&nbsp;PSockAddrIn = ^TSockAddrIn;<br>&nbsp;{$EXTERNALSYM sockaddr_in}<br>&nbsp;sockaddr_in = record<br>&nbsp; &nbsp;case Integer of<br>&nbsp; &nbsp; &nbsp;0: (sin_family: u_short;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sin_port: u_short;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sin_addr: TInAddr;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sin_zero: array[0..7] of Char);<br>&nbsp; &nbsp; &nbsp;1: (sa_family: u_short;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sa_data: array[0..13] of Char)<br>&nbsp;end;<br>&nbsp;TSockAddrIn = sockaddr_in;<br><br>const<br>&nbsp;{$EXTERNALSYM INADDR_ANY}<br>&nbsp;INADDR_ANY &nbsp; &nbsp; &nbsp; = $00000000;<br>&nbsp;{$EXTERNALSYM INADDR_LOOPBACK}<br>&nbsp;INADDR_LOOPBACK &nbsp;= $7F000001;<br>&nbsp;{$EXTERNALSYM INADDR_BROADCAST}<br>&nbsp;INADDR_BROADCAST = -1;<br>&nbsp;{$EXTERNALSYM INADDR_NONE}<br>&nbsp;INADDR_NONE &nbsp; &nbsp; &nbsp;= -1;<br><br>&nbsp;{$EXTERNALSYM WSADESCRIPTION_LEN}<br>&nbsp;WSADESCRIPTION_LEN &nbsp; &nbsp; = &nbsp; 256;<br>&nbsp;{$EXTERNALSYM WSASYS_STATUS_LEN}<br>&nbsp;WSASYS_STATUS_LEN &nbsp; &nbsp; &nbsp;= &nbsp; 128;<br><br>type<br>&nbsp;PWSAData = ^TWSAData;<br>&nbsp;{$EXTERNALSYM WSAData}<br>&nbsp;WSAData = record // !!! also WSDATA<br>&nbsp; &nbsp;wVersion: Word;<br>&nbsp; &nbsp;wHighVersion: Word;<br>&nbsp; &nbsp;szDescription: array[0..WSADESCRIPTION_LEN] of Char;<br>&nbsp; &nbsp;szSystemStatus: array[0..WSASYS_STATUS_LEN] of Char;<br>&nbsp; &nbsp;iMaxSockets: Word;<br>&nbsp; &nbsp;iMaxUdpDg: Word;<br>&nbsp; &nbsp;lpVendorInfo: PChar;<br>&nbsp;end;<br>&nbsp;TWSAData = WSAData;<br><br>&nbsp;{$EXTERNALSYM PTransmitFileBuffers}<br>&nbsp;PTransmitFileBuffers = ^TTransmitFileBuffers;<br>&nbsp;{$EXTERNALSYM _TRANSMIT_FILE_BUFFERS}<br>&nbsp;_TRANSMIT_FILE_BUFFERS = record<br>&nbsp; &nbsp; &nbsp;Head: Pointer;<br>&nbsp; &nbsp; &nbsp;HeadLength: DWORD;<br>&nbsp; &nbsp; &nbsp;Tail: Pointer;<br>&nbsp; &nbsp; &nbsp;TailLength: DWORD;<br>&nbsp;end;<br>&nbsp;{$EXTERNALSYM TTransmitFileBuffers}<br>&nbsp;TTransmitFileBuffers = _TRANSMIT_FILE_BUFFERS;<br>&nbsp;{$EXTERNALSYM TRANSMIT_FILE_BUFFERS}<br>&nbsp;TRANSMIT_FILE_BUFFERS = _TRANSMIT_FILE_BUFFERS;<br><br><br>const<br>&nbsp;{$EXTERNALSYM TF_DISCONNECT}<br>&nbsp;TF_DISCONNECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $01;<br>&nbsp;{$EXTERNALSYM TF_REUSE_SOCKET}<br>&nbsp;TF_REUSE_SOCKET &nbsp; &nbsp; &nbsp; &nbsp; = $02;<br>&nbsp;{$EXTERNALSYM TF_WRITE_BEHIND}<br>&nbsp;TF_WRITE_BEHIND &nbsp; &nbsp; &nbsp; &nbsp; = $04;<br><br>{ Options for use with [gs]etsockopt at the IP level. }<br><br>&nbsp;{$EXTERNALSYM IP_OPTIONS}<br>&nbsp;IP_OPTIONS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1;<br>&nbsp;{$EXTERNALSYM IP_MULTICAST_IF}<br>&nbsp;IP_MULTICAST_IF &nbsp; &nbsp; = 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP multicast interface &nbsp; }<br>&nbsp;{$EXTERNALSYM IP_MULTICAST_TTL}<br>&nbsp;IP_MULTICAST_TTL &nbsp; &nbsp;= 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP multicast timetolive &nbsp;}<br>&nbsp;{$EXTERNALSYM IP_MULTICAST_LOOP}<br>&nbsp;IP_MULTICAST_LOOP &nbsp; = 4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP multicast loopback &nbsp; &nbsp;}<br>&nbsp;{$EXTERNALSYM IP_ADD_MEMBERSHIP}<br>&nbsp;IP_ADD_MEMBERSHIP &nbsp; = 5; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { add &nbsp;an IP group membership &nbsp; &nbsp; &nbsp;}<br>&nbsp;{$EXTERNALSYM IP_DROP_MEMBERSHIP}<br>&nbsp;IP_DROP_MEMBERSHIP &nbsp;= 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { drop an IP group membership &nbsp; &nbsp; &nbsp;}<br>&nbsp;{$EXTERNALSYM IP_TTL}<br>&nbsp;IP_TTL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 7; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP Time To Live &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp;{$EXTERNALSYM IP_TOS}<br>&nbsp;IP_TOS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 8; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP Type Of Service &nbsp; &nbsp; &nbsp; }<br>&nbsp;{$EXTERNALSYM IP_DONTFRAGMENT}<br>&nbsp;IP_DONTFRAGMENT &nbsp; &nbsp; = 9; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { set/get IP Don't Fragment flag &nbsp; }<br><br><br>&nbsp;{$EXTERNALSYM IP_DEFAULT_MULTICAST_TTL}<br>&nbsp;IP_DEFAULT_MULTICAST_TTL &nbsp; = 1; &nbsp; &nbsp;{ normally limit m'casts to 1 hop &nbsp;}<br>&nbsp;{$EXTERNALSYM IP_DEFAULT_MULTICAST_LOOP}<br>&nbsp;IP_DEFAULT_MULTICAST_LOOP &nbsp;= 1; &nbsp; &nbsp;{ normally hear sends if a member &nbsp;}<br>&nbsp;{$EXTERNALSYM IP_MAX_MEMBERSHIPS}<br>&nbsp;IP_MAX_MEMBERSHIPS &nbsp; &nbsp; &nbsp; &nbsp; = 20; &nbsp; { per socket; must fit in one mbuf }<br><br>{ This is used instead of -1, since the<br>&nbsp;TSocket type is unsigned.}<br><br>&nbsp;{$EXTERNALSYM INVALID_SOCKET &nbsp; &nbsp;=}<br>&nbsp;INVALID_SOCKET &nbsp; &nbsp;= TSocket(NOT(0));<br>&nbsp;{$EXTERNALSYM SOCKET_ERROR &nbsp; &nbsp; &nbsp;=}<br>&nbsp;SOCKET_ERROR &nbsp; &nbsp; &nbsp;= -1;<br><br>{ Types }<br><br>&nbsp;{$EXTERNALSYM SOCK_STREAM}<br>&nbsp;SOCK_STREAM &nbsp; &nbsp; = 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { stream socket }<br>&nbsp;{$EXTERNALSYM SOCK_DGRAM}<br>&nbsp;SOCK_DGRAM &nbsp; &nbsp; &nbsp;= 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { datagram socket }<br>&nbsp;{$EXTERNALSYM SOCK_RAW}<br>&nbsp;SOCK_RAW &nbsp; &nbsp; &nbsp; &nbsp;= 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { raw-protocol interface }<br>&nbsp;{$EXTERNALSYM SOCK_RDM}<br>&nbsp;SOCK_RDM &nbsp; &nbsp; &nbsp; &nbsp;= 4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { reliably-delivered message }<br>&nbsp;{$EXTERNALSYM SOCK_SEQPACKET}<br>&nbsp;SOCK_SEQPACKET &nbsp;= 5; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { sequenced packet stream }<br><br>{ Option flags per-socket. }<br><br>&nbsp;{$EXTERNALSYM SO_DEBUG}<br>&nbsp;SO_DEBUG &nbsp; &nbsp; &nbsp; &nbsp;= $0001; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ turn on debugging info recording }<br>&nbsp;{$EXTERNALSYM SO_ACCEPTCONN}<br>&nbsp;SO_ACCEPTCONN &nbsp; = $0002; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ socket has had listen() }<br>&nbsp;{$EXTERNALSYM SO_REUSEADDR}<br>&nbsp;SO_REUSEADDR &nbsp; &nbsp;= $0004; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ allow local address reuse }<br>&nbsp;{$EXTERNALSYM SO_KEEPALIVE}<br>&nbsp;SO_KEEPALIVE &nbsp; &nbsp;= $0008; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ keep connections alive }<br>&nbsp;{$EXTERNALSYM SO_DONTROUTE}<br>&nbsp;SO_DONTROUTE &nbsp; &nbsp;= $0010; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ just use interface addresses }<br>&nbsp;{$EXTERNALSYM SO_BROADCAST}<br>&nbsp;SO_BROADCAST &nbsp; &nbsp;= $0020; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ permit sending of broadcast msgs }<br>&nbsp;{$EXTERNALSYM SO_USELOOPBACK}<br>&nbsp;SO_USELOOPBACK &nbsp;= $0040; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ bypass hardware when possible }<br>&nbsp;{$EXTERNALSYM SO_LINGER}<br>&nbsp;SO_LINGER &nbsp; &nbsp; &nbsp; = $0080; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ linger on close if data present }<br>&nbsp;{$EXTERNALSYM SO_OOBINLINE}<br>&nbsp;SO_OOBINLINE &nbsp; &nbsp;= $0100; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ leave received OOB data in line }<br><br>&nbsp;{$EXTERNALSYM SO_DONTLINGER}<br>&nbsp;SO_DONTLINGER &nbsp;= &nbsp; $ff7f;<br><br>{ Additional options. }<br><br>&nbsp;{$EXTERNALSYM SO_SNDBUF}<br>&nbsp;SO_SNDBUF &nbsp; &nbsp; &nbsp; = $1001; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ send buffer size }<br>&nbsp;{$EXTERNALSYM SO_RCVBUF}<br>&nbsp;SO_RCVBUF &nbsp; &nbsp; &nbsp; = $1002; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ receive buffer size }<br>&nbsp;{$EXTERNALSYM SO_SNDLOWAT}<br>&nbsp;SO_SNDLOWAT &nbsp; &nbsp; = $1003; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ send low-water mark }<br>&nbsp;{$EXTERNALSYM SO_RCVLOWAT}<br>&nbsp;SO_RCVLOWAT &nbsp; &nbsp; = $1004; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ receive low-water mark }<br>&nbsp;{$EXTERNALSYM SO_SNDTIMEO}<br>&nbsp;SO_SNDTIMEO &nbsp; &nbsp; = $1005; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ send timeout }<br>&nbsp;{$EXTERNALSYM SO_RCVTIMEO}<br>&nbsp;SO_RCVTIMEO &nbsp; &nbsp; = $1006; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ receive timeout }<br>&nbsp;{$EXTERNALSYM SO_ERROR}<br>&nbsp;SO_ERROR &nbsp; &nbsp; &nbsp; &nbsp;= $1007; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ get error status and clear }<br>&nbsp;{$EXTERNALSYM SO_TYPE}<br>&nbsp;SO_TYPE &nbsp; &nbsp; &nbsp; &nbsp; = $1008; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ get socket type }<br><br>{ Options for connect and disconnect data and options. &nbsp;Used only by<br>&nbsp;non-TCP/IP transports such as DECNet, OSI TP4, etc. }<br><br>&nbsp;{$EXTERNALSYM SO_CONNDATA}<br>&nbsp;SO_CONNDATA &nbsp; &nbsp; = $7000;<br>&nbsp;{$EXTERNALSYM SO_CONNOPT}<br>&nbsp;SO_CONNOPT &nbsp; &nbsp; &nbsp;= $7001;<br>&nbsp;{$EXTERNALSYM SO_DISCDATA}<br>&nbsp;SO_DISCDATA &nbsp; &nbsp; = $7002;<br>&nbsp;{$EXTERNALSYM SO_DISCOPT}<br>&nbsp;SO_DISCOPT &nbsp; &nbsp; &nbsp;= $7003;<br>&nbsp;{$EXTERNALSYM SO_CONNDATALEN}<br>&nbsp;SO_CONNDATALEN &nbsp;= $7004;<br>&nbsp;{$EXTERNALSYM SO_CONNOPTLEN}<br>&nbsp;SO_CONNOPTLEN &nbsp; = $7005;<br>&nbsp;{$EXTERNALSYM SO_DISCDATALEN}<br>&nbsp;SO_DISCDATALEN &nbsp;= $7006;<br>&nbsp;{$EXTERNALSYM SO_DISCOPTLEN}<br>&nbsp;SO_DISCOPTLEN &nbsp; = $7007;<br><br>{ Option for opening sockets for synchronous access. }<br><br>&nbsp;{$EXTERNALSYM SO_OPENTYPE}<br>&nbsp;SO_OPENTYPE &nbsp; &nbsp; = $7008;<br><br>&nbsp;{$EXTERNALSYM SO_SYNCHRONOUS_ALERT}<br>&nbsp;SO_SYNCHRONOUS_ALERT &nbsp; &nbsp;= $10;<br>&nbsp;{$EXTERNALSYM SO_SYNCHRONOUS_NONALERT}<br>&nbsp;SO_SYNCHRONOUS_NONALERT = $20;<br><br>{ Other NT-specific options. }<br><br>&nbsp;{$EXTERNALSYM SO_MAXDG}<br>&nbsp;SO_MAXDG &nbsp; &nbsp; &nbsp; &nbsp;= $7009;<br>&nbsp;{$EXTERNALSYM SO_MAXPATHDG}<br>&nbsp;SO_MAXPATHDG &nbsp; &nbsp;= $700A;<br>&nbsp;{$EXTERNALSYM SO_UPDATE_ACCEPT_CONTEXT}<br>&nbsp;SO_UPDATE_ACCEPT_CONTEXT &nbsp; &nbsp; = $700B;<br>&nbsp;{$EXTERNALSYM SO_CONNECT_TIME}<br>&nbsp;SO_CONNECT_TIME = $700C;<br><br>{ TCP options. }<br><br>&nbsp;{$EXTERNALSYM TCP_NODELAY}<br>&nbsp;TCP_NODELAY &nbsp; &nbsp; = $0001;<br>&nbsp;{$EXTERNALSYM TCP_BSDURGENT}<br>&nbsp;TCP_BSDURGENT &nbsp; = $7000;<br><br>{ Address families. }<br><br>&nbsp;{$EXTERNALSYM AF_UNSPEC}<br>&nbsp;AF_UNSPEC &nbsp; &nbsp; &nbsp; = 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { unspecified }<br>&nbsp;{$EXTERNALSYM AF_UNIX}<br>&nbsp;AF_UNIX &nbsp; &nbsp; &nbsp; &nbsp; = 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { local to host (pipes, portals) }<br>&nbsp;{$EXTERNALSYM AF_INET}<br>&nbsp;AF_INET &nbsp; &nbsp; &nbsp; &nbsp; = 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { internetwork: UDP, TCP, etc. }<br>&nbsp;{$EXTERNALSYM AF_IMPLINK}<br>&nbsp;AF_IMPLINK &nbsp; &nbsp; &nbsp;= 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { arpanet imp addresses }<br>&nbsp;{$EXTERNALSYM AF_PUP}<br>&nbsp;AF_PUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { pup protocols: e.g. BSP }<br>&nbsp;{$EXTERNALSYM AF_CHAOS}<br>&nbsp;AF_CHAOS &nbsp; &nbsp; &nbsp; &nbsp;= 5; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { mit CHAOS protocols }<br>&nbsp;{$EXTERNALSYM AF_IPX}<br>&nbsp;AF_IPX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { IPX and SPX }<br>&nbsp;{$EXTERNALSYM AF_NS}<br>&nbsp;AF_NS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 6; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { XEROX NS protocols }<br>&nbsp;{$EXTERNALSYM AF_ISO}<br>&nbsp;AF_ISO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 7; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { ISO protocols }<br>&nbsp;{$EXTERNALSYM AF_OSI}<br>&nbsp;AF_OSI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_ISO; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ OSI is ISO }<br>&nbsp;{$EXTERNALSYM AF_ECMA}<br>&nbsp;AF_ECMA &nbsp; &nbsp; &nbsp; &nbsp; = 8; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { european computer manufacturers }<br>&nbsp;{$EXTERNALSYM AF_DATAKIT}<br>&nbsp;AF_DATAKIT &nbsp; &nbsp; &nbsp;= 9; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { datakit protocols }<br>&nbsp;{$EXTERNALSYM AF_CCITT}<br>&nbsp;AF_CCITT &nbsp; &nbsp; &nbsp; &nbsp;= 10; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ CCITT protocols, X.25 etc }<br>&nbsp;{$EXTERNALSYM AF_SNA}<br>&nbsp;AF_SNA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 11; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ IBM SNA }<br>&nbsp;{$EXTERNALSYM AF_DECnet}<br>&nbsp;AF_DECnet &nbsp; &nbsp; &nbsp; = 12; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ DECnet }<br>&nbsp;{$EXTERNALSYM AF_DLI}<br>&nbsp;AF_DLI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 13; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Direct data link interface }<br>&nbsp;{$EXTERNALSYM AF_LAT}<br>&nbsp;AF_LAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 14; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ LAT }<br>&nbsp;{$EXTERNALSYM AF_HYLINK}<br>&nbsp;AF_HYLINK &nbsp; &nbsp; &nbsp; = 15; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ NSC Hyperchannel }<br>&nbsp;{$EXTERNALSYM AF_APPLETALK}<br>&nbsp;AF_APPLETALK &nbsp; &nbsp;= 16; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ AppleTalk }<br>&nbsp;{$EXTERNALSYM AF_NETBIOS}<br>&nbsp;AF_NETBIOS &nbsp; &nbsp; &nbsp;= 17; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ NetBios-style addresses }<br>&nbsp;{$EXTERNALSYM AF_VOICEVIEW}<br>&nbsp;AF_VOICEVIEW &nbsp; &nbsp;= 18; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ VoiceView }<br>&nbsp;{$EXTERNALSYM AF_FIREFOX}<br>&nbsp;AF_FIREFOX &nbsp; &nbsp; &nbsp;= 19; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ FireFox }<br>&nbsp;{$EXTERNALSYM AF_UNKNOWN1}<br>&nbsp;AF_UNKNOWN1 &nbsp; &nbsp; = 20; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Somebody is using this! }<br>&nbsp;{$EXTERNALSYM AF_BAN}<br>&nbsp;AF_BAN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 21; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Banyan }<br><br>&nbsp;{$EXTERNALSYM AF_MAX}<br>&nbsp;AF_MAX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 22;<br><br>type<br>&nbsp;{ Structure used by kernel to store most addresses. }<br><br>&nbsp;{$EXTERNALSYM PSOCKADDR}<br>&nbsp;PSOCKADDR = ^TSockAddr;<br>&nbsp;{$EXTERNALSYM TSockAddr}<br>&nbsp;TSockAddr = sockaddr_in;<br><br><br>&nbsp;{ Structure used by kernel to pass protocol information in raw sockets. }<br>&nbsp;PSockProto = ^TSockProto;<br>&nbsp;{$EXTERNALSYM sockproto}<br>&nbsp;sockproto = record<br>&nbsp; &nbsp;sp_family: u_short;<br>&nbsp; &nbsp;sp_protocol: u_short;<br>&nbsp;end;<br>&nbsp;TSockProto = sockproto;<br><br>const<br>{ Protocol families, same as address families for now. }<br><br>&nbsp;{$EXTERNALSYM PF_UNSPEC}<br>&nbsp;PF_UNSPEC &nbsp; &nbsp; &nbsp; = AF_UNSPEC;<br>&nbsp;{$EXTERNALSYM PF_UNIX}<br>&nbsp;PF_UNIX &nbsp; &nbsp; &nbsp; &nbsp; = AF_UNIX;<br>&nbsp;{$EXTERNALSYM PF_INET}<br>&nbsp;PF_INET &nbsp; &nbsp; &nbsp; &nbsp; = AF_INET;<br>&nbsp;{$EXTERNALSYM PF_IMPLINK}<br>&nbsp;PF_IMPLINK &nbsp; &nbsp; &nbsp;= AF_IMPLINK;<br>&nbsp;{$EXTERNALSYM PF_PUP}<br>&nbsp;PF_PUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_PUP;<br>&nbsp;{$EXTERNALSYM PF_CHAOS}<br>&nbsp;PF_CHAOS &nbsp; &nbsp; &nbsp; &nbsp;= AF_CHAOS;<br>&nbsp;{$EXTERNALSYM PF_NS}<br>&nbsp;PF_NS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = AF_NS;<br>&nbsp;{$EXTERNALSYM PF_IPX}<br>&nbsp;PF_IPX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_IPX;<br>&nbsp;{$EXTERNALSYM PF_ISO}<br>&nbsp;PF_ISO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_ISO;<br>&nbsp;{$EXTERNALSYM PF_OSI}<br>&nbsp;PF_OSI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_OSI;<br>&nbsp;{$EXTERNALSYM PF_ECMA}<br>&nbsp;PF_ECMA &nbsp; &nbsp; &nbsp; &nbsp; = AF_ECMA;<br>&nbsp;{$EXTERNALSYM PF_DATAKIT}<br>&nbsp;PF_DATAKIT &nbsp; &nbsp; &nbsp;= AF_DATAKIT;<br>&nbsp;{$EXTERNALSYM PF_CCITT}<br>&nbsp;PF_CCITT &nbsp; &nbsp; &nbsp; &nbsp;= AF_CCITT;<br>&nbsp;{$EXTERNALSYM PF_SNA}<br>&nbsp;PF_SNA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_SNA;<br>&nbsp;{$EXTERNALSYM PF_DECnet}<br>&nbsp;PF_DECnet &nbsp; &nbsp; &nbsp; = AF_DECnet;<br>&nbsp;{$EXTERNALSYM PF_DLI}<br>&nbsp;PF_DLI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_DLI;<br>&nbsp;{$EXTERNALSYM PF_LAT}<br>&nbsp;PF_LAT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_LAT;<br>&nbsp;{$EXTERNALSYM PF_HYLINK}<br>&nbsp;PF_HYLINK &nbsp; &nbsp; &nbsp; = AF_HYLINK;<br>&nbsp;{$EXTERNALSYM PF_APPLETALK}<br>&nbsp;PF_APPLETALK &nbsp; &nbsp;= AF_APPLETALK;<br>&nbsp;{$EXTERNALSYM PF_VOICEVIEW}<br>&nbsp;PF_VOICEVIEW &nbsp; &nbsp;= AF_VOICEVIEW;<br>&nbsp;{$EXTERNALSYM PF_FIREFOX}<br>&nbsp;PF_FIREFOX &nbsp; &nbsp; &nbsp;= AF_FIREFOX;<br>&nbsp;{$EXTERNALSYM PF_UNKNOWN1}<br>&nbsp;PF_UNKNOWN1 &nbsp; &nbsp; = AF_UNKNOWN1;<br>&nbsp;{$EXTERNALSYM PF_BAN}<br>&nbsp;PF_BAN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_BAN;<br><br>&nbsp;{$EXTERNALSYM PF_MAX}<br>&nbsp;PF_MAX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= AF_MAX;<br><br>type<br>{ Structure used for manipulating linger option. }<br>&nbsp;PLinger = ^TLinger;<br>&nbsp;{$EXTERNALSYM linger}<br>&nbsp;linger = record<br>&nbsp; &nbsp;l_onoff: u_short;<br>&nbsp; &nbsp;l_linger: u_short;<br>&nbsp;end;<br>&nbsp;TLinger = linger;<br><br>const<br>{ Level number for (get/set)sockopt() to apply to socket itself. }<br><br>&nbsp;{$EXTERNALSYM SOL_SOCKET}<br>&nbsp;SOL_SOCKET &nbsp; &nbsp; &nbsp;= $ffff; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{options for socket level }<br><br>{ Maximum queue length specifiable by listen. }<br><br>&nbsp;{$EXTERNALSYM SOMAXCONN}<br>&nbsp;SOMAXCONN &nbsp; &nbsp; &nbsp; = 5;<br><br>&nbsp;{$EXTERNALSYM MSG_OOB}<br>&nbsp;MSG_OOB &nbsp; &nbsp; &nbsp; &nbsp; = $1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {process out-of-band data }<br>&nbsp;{$EXTERNALSYM MSG_PEEK}<br>&nbsp;MSG_PEEK &nbsp; &nbsp; &nbsp; &nbsp;= $2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {peek at incoming message }<br>&nbsp;{$EXTERNALSYM MSG_DONTROUTE}<br>&nbsp;MSG_DONTROUTE &nbsp; = $4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {send without using routing tables }<br><br>&nbsp;{$EXTERNALSYM MSG_MAXIOVLEN}<br>&nbsp;MSG_MAXIOVLEN &nbsp; = 16;<br><br>&nbsp;{$EXTERNALSYM MSG_PARTIAL}<br>&nbsp;MSG_PARTIAL &nbsp; &nbsp; = $8000; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{partial send or recv for message xport }<br><br>{ Define constant based on rfc883, used by gethostbyxxxx() calls. }<br><br>&nbsp;{$EXTERNALSYM MAXGETHOSTSTRUCT}<br>&nbsp;MAXGETHOSTSTRUCT &nbsp; &nbsp; &nbsp; &nbsp;= 1024;<br><br>{ Define flags to be used with the WSAAsyncSelect() call. }<br><br>&nbsp;{$EXTERNALSYM FD_READ}<br>&nbsp;FD_READ &nbsp; &nbsp; &nbsp; &nbsp; = $01;<br>&nbsp;{$EXTERNALSYM FD_WRITE}<br>&nbsp;FD_WRITE &nbsp; &nbsp; &nbsp; &nbsp;= $02;<br>&nbsp;{$EXTERNALSYM FD_OOB}<br>&nbsp;FD_OOB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $04;<br>&nbsp;{$EXTERNALSYM FD_ACCEPT}<br>&nbsp;FD_ACCEPT &nbsp; &nbsp; &nbsp; = $08;<br>&nbsp;{$EXTERNALSYM FD_CONNECT}<br>&nbsp;FD_CONNECT &nbsp; &nbsp; &nbsp;= $10;<br>&nbsp;{$EXTERNALSYM FD_CLOSE}<br>&nbsp;FD_CLOSE &nbsp; &nbsp; &nbsp; &nbsp;= $20;<br><br>{ All Windows Sockets error constants are biased by WSABASEERR from the "normal" }<br><br>&nbsp;{$EXTERNALSYM WSABASEERR}<br>&nbsp;WSABASEERR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 10000;<br><br>{ Windows Sockets definitions of regular Microsoft C error constants }<br><br>&nbsp;{$EXTERNALSYM WSAEINTR}<br>&nbsp;WSAEINTR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+4);<br>&nbsp;{$EXTERNALSYM WSAEBADF}<br>&nbsp;WSAEBADF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+9);<br>&nbsp;{$EXTERNALSYM WSAEACCES}<br>&nbsp;WSAEACCES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+13);<br>&nbsp;{$EXTERNALSYM WSAEFAULT}<br>&nbsp;WSAEFAULT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+14);<br>&nbsp;{$EXTERNALSYM WSAEINVAL}<br>&nbsp;WSAEINVAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+22);<br>&nbsp;{$EXTERNALSYM WSAEMFILE}<br>&nbsp;WSAEMFILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+24);<br><br>{ Windows Sockets definitions of regular Berkeley error constants }<br><br>&nbsp;{$EXTERNALSYM WSAEWOULDBLOCK}<br>&nbsp;WSAEWOULDBLOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+35);<br>&nbsp;{$EXTERNALSYM WSAEINPROGRESS}<br>&nbsp;WSAEINPROGRESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+36);<br>&nbsp;{$EXTERNALSYM WSAEALREADY}<br>&nbsp;WSAEALREADY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+37);<br>&nbsp;{$EXTERNALSYM WSAENOTSOCK}<br>&nbsp;WSAENOTSOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+38);<br>&nbsp;{$EXTERNALSYM WSAEDESTADDRREQ}<br>&nbsp;WSAEDESTADDRREQ &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+39);<br>&nbsp;{$EXTERNALSYM WSAEMSGSIZE}<br>&nbsp;WSAEMSGSIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+40);<br>&nbsp;{$EXTERNALSYM WSAEPROTOTYPE}<br>&nbsp;WSAEPROTOTYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+41);<br>&nbsp;{$EXTERNALSYM WSAENOPROTOOPT}<br>&nbsp;WSAENOPROTOOPT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+42);<br>&nbsp;{$EXTERNALSYM WSAEPROTONOSUPPORT}<br>&nbsp;WSAEPROTONOSUPPORT &nbsp; &nbsp; &nbsp;= (WSABASEERR+43);<br>&nbsp;{$EXTERNALSYM WSAESOCKTNOSUPPORT}<br>&nbsp;WSAESOCKTNOSUPPORT &nbsp; &nbsp; &nbsp;= (WSABASEERR+44);<br>&nbsp;{$EXTERNALSYM WSAEOPNOTSUPP}<br>&nbsp;WSAEOPNOTSUPP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+45);<br>&nbsp;{$EXTERNALSYM WSAEPFNOSUPPORT}<br>&nbsp;WSAEPFNOSUPPORT &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+46);<br>&nbsp;{$EXTERNALSYM WSAEAFNOSUPPORT}<br>&nbsp;WSAEAFNOSUPPORT &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+47);<br>&nbsp;{$EXTERNALSYM WSAEADDRINUSE}<br>&nbsp;WSAEADDRINUSE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+48);<br>&nbsp;{$EXTERNALSYM WSAEADDRNOTAVAIL}<br>&nbsp;WSAEADDRNOTAVAIL &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+49);<br>&nbsp;{$EXTERNALSYM WSAENETDOWN}<br>&nbsp;WSAENETDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+50);<br>&nbsp;{$EXTERNALSYM WSAENETUNREACH}<br>&nbsp;WSAENETUNREACH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+51);<br>&nbsp;{$EXTERNALSYM WSAENETRESET}<br>&nbsp;WSAENETRESET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+52);<br>&nbsp;{$EXTERNALSYM WSAECONNABORTED}<br>&nbsp;WSAECONNABORTED &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+53);<br>&nbsp;{$EXTERNALSYM WSAECONNRESET}<br>&nbsp;WSAECONNRESET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+54);<br>&nbsp;{$EXTERNALSYM WSAENOBUFS}<br>&nbsp;WSAENOBUFS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+55);<br>&nbsp;{$EXTERNALSYM WSAEISCONN}<br>&nbsp;WSAEISCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+56);<br>&nbsp;{$EXTERNALSYM WSAENOTCONN}<br>&nbsp;WSAENOTCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+57);<br>&nbsp;{$EXTERNALSYM WSAESHUTDOWN}<br>&nbsp;WSAESHUTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+58);<br>&nbsp;{$EXTERNALSYM WSAETOOMANYREFS}<br>&nbsp;WSAETOOMANYREFS &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+59);<br>&nbsp;{$EXTERNALSYM WSAETIMEDOUT}<br>&nbsp;WSAETIMEDOUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+60);<br>&nbsp;{$EXTERNALSYM WSAECONNREFUSED}<br>&nbsp;WSAECONNREFUSED &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+61);<br>&nbsp;{$EXTERNALSYM WSAELOOP}<br>&nbsp;WSAELOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+62);<br>&nbsp;{$EXTERNALSYM WSAENAMETOOLONG}<br>&nbsp;WSAENAMETOOLONG &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+63);<br>&nbsp;{$EXTERNALSYM WSAEHOSTDOWN}<br>&nbsp;WSAEHOSTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+64);<br>&nbsp;{$EXTERNALSYM WSAEHOSTUNREACH}<br>&nbsp;WSAEHOSTUNREACH &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+65);<br>&nbsp;{$EXTERNALSYM WSAENOTEMPTY}<br>&nbsp;WSAENOTEMPTY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+66);<br>&nbsp;{$EXTERNALSYM WSAEPROCLIM}<br>&nbsp;WSAEPROCLIM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+67);<br>&nbsp;{$EXTERNALSYM WSAEUSERS}<br>&nbsp;WSAEUSERS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+68);<br>&nbsp;{$EXTERNALSYM WSAEDQUOT}<br>&nbsp;WSAEDQUOT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+69);<br>&nbsp;{$EXTERNALSYM WSAESTALE}<br>&nbsp;WSAESTALE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (WSABASEERR+70);<br>&nbsp;{$EXTERNALSYM WSAEREMOTE}<br>&nbsp;WSAEREMOTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+71);<br><br>&nbsp;{$EXTERNALSYM WSAEDISCON}<br>&nbsp;WSAEDISCON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+101);<br><br>{ Extended Windows Sockets error constant definitions }<br><br>&nbsp;{$EXTERNALSYM WSASYSNOTREADY}<br>&nbsp;WSASYSNOTREADY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+91);<br>&nbsp;{$EXTERNALSYM WSAVERNOTSUPPORTED}<br>&nbsp;WSAVERNOTSUPPORTED &nbsp; &nbsp; &nbsp;= (WSABASEERR+92);<br>&nbsp;{$EXTERNALSYM WSANOTINITIALISED}<br>&nbsp;WSANOTINITIALISED &nbsp; &nbsp; &nbsp; = (WSABASEERR+93);<br><br>{ Error return codes from gethostbyname() and gethostbyaddr()<br>&nbsp;(when using the resolver). Note that these errors are<br>&nbsp;retrieved via WSAGetLastError() and must therefore follow<br>&nbsp;the rules for avoiding clashes with error numbers from<br>&nbsp;specific implementations or language run-time systems.<br>&nbsp;For this reason the codes are based at WSABASEERR+1001.<br>&nbsp;Note also that [WSA]NO_ADDRESS is defined only for<br>&nbsp;compatibility purposes. }<br><br>{ Authoritative Answer: Host not found }<br><br>&nbsp;{$EXTERNALSYM WSAHOST_NOT_FOUND}<br>&nbsp;WSAHOST_NOT_FOUND &nbsp; &nbsp; &nbsp; = (WSABASEERR+1001);<br>&nbsp;{$EXTERNALSYM HOST_NOT_FOUND}<br>&nbsp;HOST_NOT_FOUND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= WSAHOST_NOT_FOUND;<br><br>{ Non-Authoritative: Host not found, or SERVERFAIL }<br><br>&nbsp;{$EXTERNALSYM WSATRY_AGAIN}<br>&nbsp;WSATRY_AGAIN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+1002);<br>&nbsp;{$EXTERNALSYM TRY_AGAIN}<br>&nbsp;TRY_AGAIN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSATRY_AGAIN;<br><br>{ Non recoverable errors, FORMERR, REFUSED, NOTIMP }<br><br>&nbsp;{$EXTERNALSYM WSANO_RECOVERY}<br>&nbsp;WSANO_RECOVERY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+1003);<br>&nbsp;{$EXTERNALSYM NO_RECOVERY}<br>&nbsp;NO_RECOVERY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSANO_RECOVERY;<br><br>{ Valid name, no data record of requested type }<br><br>&nbsp;{$EXTERNALSYM WSANO_DATA}<br>&nbsp;WSANO_DATA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= (WSABASEERR+1004);<br>&nbsp;{$EXTERNALSYM NO_DATA}<br>&nbsp;NO_DATA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSANO_DATA;<br><br>{ no address, look for MX record }<br><br>&nbsp;{$EXTERNALSYM WSANO_ADDRESS}<br>&nbsp;WSANO_ADDRESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = WSANO_DATA;<br>&nbsp;{$EXTERNALSYM NO_ADDRESS}<br>&nbsp;NO_ADDRESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= WSANO_ADDRESS;<br><br>{ Windows Sockets errors redefined as regular Berkeley error constants.<br>&nbsp;These are commented out in Windows NT to avoid conflicts with errno.h.<br>&nbsp;Use the WSA constants instead. }<br><br>&nbsp;{$EXTERNALSYM EWOULDBLOCK}<br>&nbsp;EWOULDBLOCK &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEWOULDBLOCK;<br>&nbsp;{$EXTERNALSYM EINPROGRESS}<br>&nbsp;EINPROGRESS &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEINPROGRESS;<br>&nbsp;{$EXTERNALSYM EALREADY}<br>&nbsp;EALREADY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEALREADY;<br>&nbsp;{$EXTERNALSYM ENOTSOCK}<br>&nbsp;ENOTSOCK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAENOTSOCK;<br>&nbsp;{$EXTERNALSYM EDESTADDRREQ}<br>&nbsp;EDESTADDRREQ &nbsp; &nbsp; &nbsp; = &nbsp;WSAEDESTADDRREQ;<br>&nbsp;{$EXTERNALSYM EMSGSIZE}<br>&nbsp;EMSGSIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEMSGSIZE;<br>&nbsp;{$EXTERNALSYM EPROTOTYPE}<br>&nbsp;EPROTOTYPE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEPROTOTYPE;<br>&nbsp;{$EXTERNALSYM ENOPROTOOPT}<br>&nbsp;ENOPROTOOPT &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENOPROTOOPT;<br>&nbsp;{$EXTERNALSYM EPROTONOSUPPORT}<br>&nbsp;EPROTONOSUPPORT &nbsp; &nbsp;= &nbsp;WSAEPROTONOSUPPORT;<br>&nbsp;{$EXTERNALSYM ESOCKTNOSUPPORT}<br>&nbsp;ESOCKTNOSUPPORT &nbsp; &nbsp;= &nbsp;WSAESOCKTNOSUPPORT;<br>&nbsp;{$EXTERNALSYM EOPNOTSUPP}<br>&nbsp;EOPNOTSUPP &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEOPNOTSUPP;<br>&nbsp;{$EXTERNALSYM EPFNOSUPPORT}<br>&nbsp;EPFNOSUPPORT &nbsp; &nbsp; &nbsp; = &nbsp;WSAEPFNOSUPPORT;<br>&nbsp;{$EXTERNALSYM EAFNOSUPPORT}<br>&nbsp;EAFNOSUPPORT &nbsp; &nbsp; &nbsp; = &nbsp;WSAEAFNOSUPPORT;<br>&nbsp;{$EXTERNALSYM EADDRINUSE}<br>&nbsp;EADDRINUSE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEADDRINUSE;<br>&nbsp;{$EXTERNALSYM EADDRNOTAVAIL}<br>&nbsp;EADDRNOTAVAIL &nbsp; &nbsp; &nbsp;= &nbsp;WSAEADDRNOTAVAIL;<br>&nbsp;{$EXTERNALSYM ENETDOWN}<br>&nbsp;ENETDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAENETDOWN;<br>&nbsp;{$EXTERNALSYM ENETUNREACH}<br>&nbsp;ENETUNREACH &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENETUNREACH;<br>&nbsp;{$EXTERNALSYM ENETRESET}<br>&nbsp;ENETRESET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENETRESET;<br>&nbsp;{$EXTERNALSYM ECONNABORTED}<br>&nbsp;ECONNABORTED &nbsp; &nbsp; &nbsp; = &nbsp;WSAECONNABORTED;<br>&nbsp;{$EXTERNALSYM ECONNRESET}<br>&nbsp;ECONNRESET &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAECONNRESET;<br>&nbsp;{$EXTERNALSYM ENOBUFS}<br>&nbsp;ENOBUFS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENOBUFS;<br>&nbsp;{$EXTERNALSYM EISCONN}<br>&nbsp;EISCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEISCONN;<br>&nbsp;{$EXTERNALSYM ENOTCONN}<br>&nbsp;ENOTCONN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAENOTCONN;<br>&nbsp;{$EXTERNALSYM ESHUTDOWN}<br>&nbsp;ESHUTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAESHUTDOWN;<br>&nbsp;{$EXTERNALSYM ETOOMANYREFS}<br>&nbsp;ETOOMANYREFS &nbsp; &nbsp; &nbsp; = &nbsp;WSAETOOMANYREFS;<br>&nbsp;{$EXTERNALSYM ETIMEDOUT}<br>&nbsp;ETIMEDOUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAETIMEDOUT;<br>&nbsp;{$EXTERNALSYM ECONNREFUSED}<br>&nbsp;ECONNREFUSED &nbsp; &nbsp; &nbsp; = &nbsp;WSAECONNREFUSED;<br>&nbsp;{$EXTERNALSYM ELOOP}<br>&nbsp;ELOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAELOOP;<br>&nbsp;{$EXTERNALSYM ENAMETOOLONG}<br>&nbsp;ENAMETOOLONG &nbsp; &nbsp; &nbsp; = &nbsp;WSAENAMETOOLONG;<br>&nbsp;{$EXTERNALSYM EHOSTDOWN}<br>&nbsp;EHOSTDOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEHOSTDOWN;<br>&nbsp;{$EXTERNALSYM EHOSTUNREACH}<br>&nbsp;EHOSTUNREACH &nbsp; &nbsp; &nbsp; = &nbsp;WSAEHOSTUNREACH;<br>&nbsp;{$EXTERNALSYM ENOTEMPTY}<br>&nbsp;ENOTEMPTY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAENOTEMPTY;<br>&nbsp;{$EXTERNALSYM EPROCLIM}<br>&nbsp;EPROCLIM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEPROCLIM;<br>&nbsp;{$EXTERNALSYM EUSERS}<br>&nbsp;EUSERS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEUSERS;<br>&nbsp;{$EXTERNALSYM EDQUOT}<br>&nbsp;EDQUOT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAEDQUOT;<br>&nbsp;{$EXTERNALSYM ESTALE}<br>&nbsp;ESTALE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;WSAESTALE;<br>&nbsp;{$EXTERNALSYM EREMOTE}<br>&nbsp;EREMOTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;WSAEREMOTE;<br><br>type<br>&nbsp;LPVOID = Pointer;<br>&nbsp;PINT = ^Integer;<br>&nbsp;LPINT = PINT;<br><br>&nbsp;SOCKADDR &nbsp; &nbsp;= TSockAddr;<br><br>&nbsp;LPSOCKADDR = ^sockaddr;<br>&nbsp;LPSERVICE_ASYNC_INFO=Pointer;<br><br>&nbsp;SERVICE_ADDRESS=packed record<br>&nbsp; &nbsp;dwAddressType:DWORD;<br>&nbsp; &nbsp;dwAddressFlags:DWORD;<br>&nbsp; &nbsp;dwAddressLength:DWORD;<br>&nbsp; &nbsp;dwPrincipalLength:DWORD;<br>&nbsp; &nbsp;lpAddress:BYTE;<br>&nbsp; &nbsp;lpPrincipal:BYTE;<br>&nbsp;end;<br><br>&nbsp;SERVICE_ADDRESSES=packed record<br>&nbsp; &nbsp;dwAddressCount:DWORD;<br>&nbsp; &nbsp;Addresses:array [1..1] of SERVICE_ADDRESS;<br>&nbsp;end;<br><br>&nbsp;LPSERVICE_ADDRESSES=^SERVICE_ADDRESSES;<br><br>&nbsp;BLOB=packed record<br>&nbsp; &nbsp;cbSize:ULONG;<br>&nbsp; &nbsp;pBlobData:BYTE;<br>&nbsp;end;<br><br>&nbsp;TGUID = packed record<br>&nbsp; &nbsp;D1: LongInt;<br>&nbsp; &nbsp;D2: Word;<br>&nbsp; &nbsp;D3: Word;<br>&nbsp; &nbsp;D4: Array[0..7] of Byte;<br>&nbsp;end;<br>&nbsp;PGUID = ^TGUID;<br>&nbsp;LPGUID = PGUID;<br><br>&nbsp;SERVICE_INFO=packed record<br>&nbsp; &nbsp;lpServiceType:LPGUID;<br>&nbsp; &nbsp;lpServiceName:LPTSTR;<br>&nbsp; &nbsp;lpComment:LPTSTR;<br>&nbsp; &nbsp;lpLocale:LPTSTR;<br>&nbsp; &nbsp;dwDisplayHint:DWORD;<br>&nbsp; &nbsp;dwVersion:DWORD;<br>&nbsp; &nbsp;dwTime:DWORD;<br>&nbsp; &nbsp;lpMachineName:LPTSTR;<br>&nbsp; &nbsp;lpServiceAddress:LPSERVICE_ADDRESSES;<br>&nbsp; &nbsp;ServiceSpecificInfo:BLOB;<br>&nbsp;end;<br><br>&nbsp;LPSERVICE_INFO=^SERVICE_INFO;<br><br>{ Socket function prototypes }<br><br>function EnumProtocolsA(lpiProtocols:LPINT;lpProtocolBuffer:LPVOID;lpdwBufferLength:LPDWORD):integer;stdcall;<br>function EnumProtocolsW(lpiProtocols:LPINT;lpProtocolBuffer:LPVOID;lpdwBufferLength:LPDWORD):integer;stdcall;<br>function GetAddressByNameA(dwNameSpace:DWORD;lpServiceType:LPGUID;lpServiceName:LPTSTR;<br>&nbsp;lpiProtocols:LPINT;dwResolution:DWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;<br>&nbsp;lpCsaddrBuffer:LPVOID;lpdwBufferLength:LPDWORD;lpAliasBuffer:LPTSTR;<br>&nbsp;var lpdwAliasBufferLength:DWORD):integer;stdcall;<br>function GetAddressByNameW(dwNameSpace:DWORD;lpServiceType:LPGUID;lpServiceName:LPTSTR;<br>&nbsp;lpiProtocols:LPINT;dwResolution:DWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;<br>&nbsp;lpCsaddrBuffer:LPVOID;lpdwBufferLength:LPDWORD;lpAliasBuffer:LPTSTR;<br>&nbsp;var lpdwAliasBufferLength:DWORD):integer;stdcall;<br>function GetNameByTypeA(lpServiceType:LPGUID;lpServiceName:LPTSTR;dwNameLength:DWORD):integer;stdcall;<br>function GetNameByTypeW(lpServiceType:LPGUID;lpServiceName:LPTSTR;dwNameLength:DWORD):integer;stdcall;<br>function GetServiceA(dwNameSpace:DWORD;lpGuid:PGUID;lpServiceName:LPTSTR;dwProperties:DWORD;<br>&nbsp;lpBuffer:LPVOID;lpdwBufferSize:LPDWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO):integer;stdcall;<br>function GetServiceW(dwNameSpace:DWORD;lpGuid:PGUID;lpServiceName:LPTSTR;dwProperties:DWORD;<br>&nbsp;lpBuffer:LPVOID;lpdwBufferSize:LPDWORD;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO):integer;stdcall;<br>function GetTypeByNameA(lpServiceName:LPTSTR;lpServiceType:PGUID):integer;stdcall;<br>function GetTypeByNameW(lpServiceName:LPTSTR;lpServiceType:PGUID):integer;stdcall;<br>function MigrateWinsockConfiguration(p,q,r:integer):integer;stdcall;<br>function NPLoadNameSpaces(p,q,r:integer):integer;stdcall;<br>function SetServiceA(dwNameSpace,dwOperation,dwFlags:DWORD;lpServiceInfo:LPSERVICE_INFO;<br>&nbsp;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;lpdwStatusFlags:LPDWORD):integer;stdcall;<br>function SetServiceW(dwNameSpace,dwOperation,dwFlags:DWORD;lpServiceInfo:LPSERVICE_INFO;<br>&nbsp;lpServiceAsyncInfo:LPSERVICE_ASYNC_INFO;lpdwStatusFlags:LPDWORD):integer;stdcall;<br>function dn_expand(a0,a1,a2,a3,a4:integer):integer;stdcall;<br>function inet_network(a0:integer):integer;stdcall;<br>function getnetbyname(a0:integer):integer;stdcall;<br>function rcmd(a0,a1,a2,a3,a4,a5:integer):integer;stdcall;<br>function rexec(a0,a1,a2,a3,a4,a5:integer):integer;stdcall;<br>function rresvport(a0:integer):integer;stdcall;<br>function s_perror(a0,a1:integer):integer;stdcall;<br>function sethostname(a0,a1:integer):integer;stdcall;<br><br><br><br><br>function wep:integer;stdcall;<br>function WSApSetPostRoutine(a0:integer):integer;stdcall;<br><br>{$EXTERNALSYM accept}<br>function accept(s: TSocket; addr: PSockAddr; addrlen: PInteger): TSocket; stdcall;<br>{$EXTERNALSYM bind}<br>function bind(s: TSocket; var addr: TSockAddr; namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM closesocket}<br>function closesocket(s: TSocket): Integer; stdcall;<br>{$EXTERNALSYM connect}<br>function connect(s: TSocket; var name: TSockAddr; namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM ioctlsocket}<br>function ioctlsocket(s: TSocket; cmd: DWORD; var arg: u_long): Integer; stdcall;<br>{$EXTERNALSYM getpeername}<br>function getpeername(s: TSocket; var name: TSockAddr; var namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM getsockname}<br>function getsockname(s: TSocket; var name: TSockAddr; var namelen: Integer): Integer; stdcall;<br>{$EXTERNALSYM getsockopt}<br>function getsockopt(s: TSocket; level, optname: Integer; optval: PChar; var optlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM htonl}<br>function htonl(hostlong: u_long): u_long; stdcall;<br>{$EXTERNALSYM htons}<br>function htons(hostshort: u_short): u_short; stdcall;<br>{$EXTERNALSYM inet_addr}<br>function inet_addr(cp: PChar): u_long; stdcall; {PInAddr;} &nbsp;{ TInAddr }<br>{$EXTERNALSYM inet_ntoa}<br>function inet_ntoa(inaddr: TInAddr): PChar; stdcall;<br>{$EXTERNALSYM listen}<br>function listen(s: TSocket; backlog: Integer): Integer; stdcall;<br>{$EXTERNALSYM ntohl}<br>function ntohl(netlong: u_long): u_long; stdcall;<br>{$EXTERNALSYM ntohs}<br>function ntohs(netshort: u_short): u_short; stdcall;<br>{$EXTERNALSYM recv}<br>function recv(s: TSocket; var Buf; len, flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM recvfrom}<br>function recvfrom(s: TSocket; var Buf; len, flags: Integer;<br>&nbsp;var from: TSockAddr; var fromlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM select}<br>function select(nfds: Integer; readfds, writefds, exceptfds: PFDSet;<br>&nbsp;timeout: PTimeVal): Longint; stdcall;<br>{$EXTERNALSYM send}<br>function send(s: TSocket; var Buf; len, flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM sendto}<br>function sendto(s: TSocket; var Buf; len, flags: Integer; var addrto: TSockAddr;<br>&nbsp;tolen: Integer): Integer; stdcall;<br>{$EXTERNALSYM setsockopt}<br>function setsockopt(s: TSocket; level, optname: Integer; optval: PChar;<br>&nbsp;optlen: Integer): Integer; stdcall;<br>{$EXTERNALSYM shutdown}<br>function shutdown(s: TSocket; how: Integer): Integer; stdcall;<br>{$EXTERNALSYM socket}<br>function socket(af, Struct, protocol: Integer): TSocket; stdcall;<br>{$EXTERNALSYM gethostbyaddr}<br>function gethostbyaddr(addr: Pointer; len, Struct: Integer): PHostEnt; stdcall;<br>{$EXTERNALSYM gethostbyname}<br>function gethostbyname(name: PChar): PHostEnt; stdcall;<br>{$EXTERNALSYM gethostname}<br>function gethostname(name: PChar; len: Integer): Integer; stdcall;<br>{$EXTERNALSYM getservbyport}<br>function getservbyport(port: Integer; proto: PChar): PServEnt; stdcall;<br>{$EXTERNALSYM getservbyname}<br>function getservbyname(name, proto: PChar): PServEnt; stdcall;<br>{$EXTERNALSYM getprotobynumber}<br>function getprotobynumber(proto: Integer): PProtoEnt; stdcall;<br>{$EXTERNALSYM getprotobyname}<br>function getprotobyname(name: PChar): PProtoEnt; stdcall;<br>{$EXTERNALSYM WSAStartup}<br>function WSAStartup(wVersionRequired: word; var WSData: TWSAData): Integer; stdcall;<br>{$EXTERNALSYM WSACleanup}<br>function WSACleanup: Integer; stdcall;<br>{$EXTERNALSYM WSASetLastError}<br>procedure WSASetLastError(iError: Integer); stdcall;<br>{$EXTERNALSYM WSAGetLastError}<br>function WSAGetLastError: Integer; stdcall;<br>{$EXTERNALSYM WSAIsBlocking}<br>function WSAIsBlocking: BOOL; stdcall;<br>{$EXTERNALSYM WSAUnhookBlockingHook}<br>function WSAUnhookBlockingHook: Integer; stdcall;<br>{$EXTERNALSYM WSASetBlockingHook}<br>function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc; stdcall;<br>{$EXTERNALSYM WSACancelBlockingCall}<br>function WSACancelBlockingCall: Integer; stdcall;<br>{$EXTERNALSYM WSAAsyncGetServByName}<br>function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int;<br>&nbsp;name, proto, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetServByPort}<br>function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int;<br>&nbsp;proto, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetProtoByName}<br>function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int;<br>&nbsp;name, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetProtoByNumber}<br>function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Integer;<br>&nbsp;buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetHostByName}<br>function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int;<br>&nbsp;name, buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSAAsyncGetHostByAddr}<br>function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PChar;<br>&nbsp;len, Struct: Integer; buf: PChar; buflen: Integer): THandle; stdcall;<br>{$EXTERNALSYM WSACancelAsyncRequest}<br>function WSACancelAsyncRequest(hAsyncTaskHandle: THandle): Integer; stdcall;<br>{$EXTERNALSYM WSAAsyncSelect}<br>function WSAAsyncSelect(s: TSocket; HWindow: HWND; wMsg: u_int; lEvent: Longint): Integer; stdcall;<br>{$EXTERNALSYM WSARecvEx}<br>function WSARecvEx(s: TSocket; var buf; len: Integer; var flags: Integer): Integer; stdcall;<br>{$EXTERNALSYM __WSAFDIsSet}<br>function __WSAFDIsSet(s: TSocket; var FDSet: TFDSet): Bool; stdcall;<br><br>{$EXTERNALSYM TransmitFile}<br>function TransmitFile(hSocket: TSocket; hFile: THandle; nNumberOfBytesToWrite: DWORD;<br>&nbsp;nNumberOfBytesPerSend: DWORD; lpOverlapped: POverlapped;<br>&nbsp;lpTransmitBuffers: PTransmitFileBuffers; dwReserved: DWORD): BOOL; stdcall;<br><br>{$EXTERNALSYM AcceptEx}<br>function AcceptEx(sListenSocket, sAcceptSocket: TSocket;<br>&nbsp;lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength,<br>&nbsp;dwRemoteAddressLength: DWORD; var lpdwBytesReceived: DWORD;<br>&nbsp;lpOverlapped: POverlapped): BOOL; stdcall;<br><br>{$EXTERNALSYM GetAcceptExSockaddrs}<br>procedure GetAcceptExSockaddrs(lpOutputBuffer: Pointer;<br>&nbsp;dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD;<br>&nbsp;var LocalSockaddr: TSockAddr; var LocalSockaddrLength: Integer;<br>&nbsp;var RemoteSockaddr: TSockAddr; var RemoteSockaddrLength: Integer); stdcall;<br><br>{$EXTERNALSYM WSAMakeSyncReply}<br>function WSAMakeSyncReply(Buflen, Error: Word): Longint;<br>{$EXTERNALSYM WSAMakeSelectReply}<br>function WSAMakeSelectReply(Event, Error: Word): Longint;<br>{$EXTERNALSYM WSAGetAsyncBuflen}<br>function WSAGetAsyncBuflen(Param: Longint): Word;<br>{$EXTERNALSYM WSAGetAsyncError}<br>function WSAGetAsyncError(Param: Longint): Word;<br>{$EXTERNALSYM WSAGetSelectEvent}<br>function WSAGetSelectEvent(Param: Longint): Word;<br>{$EXTERNALSYM WSAGetSelectError}<br>function WSAGetSelectError(Param: Longint): Word;<br><br>{$EXTERNALSYM FD_CLR}<br>procedure FD_CLR(Socket: TSocket; var FDSet: TFDSet);<br>{$EXTERNALSYM FD_ISSET}<br>function FD_ISSET(Socket: TSocket; var FDSet: TFDSet): Boolean;<br>{$EXTERNALSYM FD_SET}<br>procedure FD_SET(Socket: TSocket; var FDSet: TFDSet); // renamed due to conflict with fd_set (above)<br>{$EXTERNALSYM FD_ZERO}<br>procedure FD_ZERO(var FDSet: TFDSet);<br><br>implementation<br><br>const<br>&nbsp;winsocket = 'wsock32.dll';<br>&nbsp;MSWSOCK='mswsock.dll';<br>&nbsp;WINSOCK32='winsock32.dll'; &nbsp; ///winnt/system32/wsock32.dll<br>&nbsp;WINSOCK2_DLL = 'ws2_32.dll';<br><br><br>function WSAMakeSyncReply;<br>begin<br>&nbsp;WSAMakeSyncReply:= MakeLong(Buflen, Error);<br>end;<br><br>function WSAMakeSelectReply;<br>begin<br>&nbsp;WSAMakeSelectReply:= MakeLong(Event, Error);<br>end;<br><br>function WSAGetAsyncBuflen;<br>begin<br>&nbsp;WSAGetAsyncBuflen:= LOWORD(Param);<br>end;<br><br>function WSAGetAsyncError;<br>begin<br>&nbsp;WSAGetAsyncError:= HIWORD(Param);<br>end;<br><br>function WSAGetSelectEvent;<br>begin<br>&nbsp;WSAGetSelectEvent:= LOWORD(Param);<br>end;<br><br>function WSAGetSelectError;<br>begin<br>&nbsp;WSAGetSelectError:= HIWORD(Param);<br>end;<br><br>procedure FD_CLR(Socket: TSocket; var FDSet: TFDSet);<br>var<br>&nbsp;I: Integer;<br>begin<br>&nbsp;I := 0;<br>&nbsp;while I &lt; FDSet.fd_count do<br>&nbsp;begin<br>&nbsp; &nbsp;if FDSet.fd_array = Socket then<br>&nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp;while I &lt; FDSet.fd_count - 1 do<br>&nbsp; &nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp; &nbsp;FDSet.fd_array := FDSet.fd_array[I + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp;Inc(I);<br>&nbsp; &nbsp; &nbsp;end;<br>&nbsp; &nbsp; &nbsp;Dec(FDSet.fd_count);<br>&nbsp; &nbsp; &nbsp;Break;<br>&nbsp; &nbsp;end;<br>&nbsp; &nbsp;Inc(I);<br>&nbsp;end;<br>end;<br><br>function FD_ISSET(Socket: TSocket; var FDSet: TFDSet): Boolean;<br>begin<br>&nbsp;Result := __WSAFDIsSet(Socket, FDSet);<br>end;<br><br>procedure FD_SET(Socket: TSocket; var FDSet: TFDSet);<br>begin<br>&nbsp;if FDSet.fd_count &lt; FD_SETSIZE then<br>&nbsp;begin<br>&nbsp; &nbsp;FDSet.fd_array[FDSet.fd_count] := Socket;<br>&nbsp; &nbsp;Inc(FDSet.fd_count);<br>&nbsp;end;<br>end;<br><br>procedure FD_ZERO(var FDSet: TFDSet);<br>begin<br>&nbsp;FDSet.fd_count := 0;<br>end;<br><br>function EnumProtocolsA; external MSWSOCK name 'enumprotocolsa';<br>function EnumProtocolsW; external MSWSOCK name 'enumprotocolsw';<br>function GetAddressByNameA; external MSWSOCK name 'getaddressbynamea';<br>function GetAddressByNameW; external MSWSOCK name 'getaddressbynamew';<br>function GetNameByTypeA; external MSWSOCK name 'getnamebytypea';<br>function GetNameByTypeW; external MSWSOCK name 'getnamebytypew';<br>function GetServiceA; external MSWSOCK name 'getservicea';<br>function GetServiceW; external MSWSOCK name 'getservicew';<br>function GetTypeByNameA; external MSWSOCK name 'gettypebynamea';<br>function GetTypeByNameW; external MSWSOCK name 'gettypebynamew';<br>function MigrateWinsockConfiguration; external MSWSOCK name 'migratewinsockconfiguration';<br>function NPLoadNameSpaces; external MSWSOCK name 'nploadnamespaces';<br>function SetServiceA; external MSWSOCK name 'setservicea';<br>function SetServiceW; external MSWSOCK name 'setservicew';<br>function dn_expand; external MSWSOCK name 'dn_expand';<br>function inet_network; external MSWSOCK name 'inet_network';<br>function getnetbyname; external MSWSOCK name 'getnetbyname';<br>function rcmd; external MSWSOCK name 'rcmd';<br>function rexec; external MSWSOCK name 'rexec';<br>function rresvport; external MSWSOCK name 'rresvport';<br>function s_perror; external MSWSOCK name 's_perror';<br>function sethostname; external MSWSOCK name 'sethostname';<br><br>function WEP; external WINSOCK2_Dll name 'wep';<br>function WSApSetPostRoutine; external WINSOCK2_Dll name 'wsapsetpostroutine';<br><br>function accept; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'accept';<br>function bind; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'bind';<br>function closesocket; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'closesocket';<br>function connect; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'connect';<br>function getpeername; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getpeername';<br>function getsockname; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getsockname';<br>function getsockopt; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'getsockopt';<br>function htonl; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'htonl';<br>function htons; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'htons';<br>function inet_addr; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'inet_addr';<br>function inet_ntoa; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'inet_ntoa';<br>function ioctlsocket; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'ioctlsocket';<br>function listen; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'listen';<br>function ntohl; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'ntohl';<br>function ntohs; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'ntohs';<br>function recv; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'recv';<br>function recvfrom; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'recvfrom';<br>function select; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'select';<br>function send; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'send';<br>function sendto; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'sendto';<br>function setsockopt; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'setsockopt';<br>function shutdown; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'shutdown';<br>function socket; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'socket';<br><br>function gethostbyaddr; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'gethostbyaddr';<br>function gethostbyname; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'gethostbyname';<br>function getprotobyname; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'getprotobyname';<br>function getprotobynumber; &nbsp;external &nbsp; &nbsp;winsocket name 'getprotobynumber';<br>function getservbyname; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getservbyname';<br>function getservbyport; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'getservbyport';<br>function gethostname; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'gethostname';<br><br>function WSAAsyncSelect; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'WSAAsyncSelect';<br>function WSARecvEx; &nbsp; &nbsp; &nbsp; &nbsp; external &nbsp; &nbsp;winsocket name 'WSARecvEx';<br>function WSAAsyncGetHostByAddr; external winsocket name 'WSAAsyncGetHostByAddr';<br>function WSAAsyncGetHostByName; external winsocket name 'WSAAsyncGetHostByName';<br>function WSAAsyncGetProtoByNumber; external winsocket name 'WSAAsyncGetProtoByNumber';<br>function WSAAsyncGetProtoByName; external winsocket name 'WSAAsyncGetProtoByName';<br>function WSAAsyncGetServByPort; external winsocket name 'WSAAsyncGetServByPort';<br>function WSAAsyncGetServByName; external winsocket name 'WSAAsyncGetServByName';<br>function WSACancelAsyncRequest; external winsocket name 'WSACancelAsyncRequest';<br>function WSASetBlockingHook; external &nbsp; &nbsp;winsocket name 'WSASetBlockingHook';<br>function WSAUnhookBlockingHook; external winsocket name 'WSAUnhookBlockingHook';<br>function WSAGetLastError; &nbsp; &nbsp;external &nbsp; &nbsp;winsocket name 'WSAGetLastError';<br>procedure WSASetLastError; &nbsp; external &nbsp; &nbsp;winsocket name 'WSASetLastError';<br>function WSACancelBlockingCall; external winsocket name 'WSACancelBlockingCall';<br>function WSAIsBlocking; &nbsp; &nbsp; external &nbsp; &nbsp; winsocket name 'WSAIsBlocking';<br>function WSAStartup; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'WSAStartup';<br>function WSACleanup; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'WSACleanup';<br>function __WSAFDIsSet; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name '__WSAFDIsSet';<br><br>function TransmitFile; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'TransmitFile';<br>function AcceptEx; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;external &nbsp; &nbsp; winsocket name 'AcceptEx';<br>procedure GetAcceptExSockaddrs; &nbsp;external &nbsp; &nbsp;winsocket name 'GetAcceptExSockaddrs';<br><br>end.<br>
 
接受答案了.
 
后退
顶部