Unit Winsock

From Ultibo.org
Revision as of 06:39, 27 September 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


Notes:

  • All BSD/Winsock functions that accept an Address or Port expect them to be in Network order.
  • All other functions that take an Address or Port expect them to be in Host order.

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

[Expand]
procedure WSInit;
Description: To be documented


[Expand]
function WSStart:Boolean;
Description: To be documented


[Expand]
function WSStop:Boolean;
Description: To be documented


[Expand]
procedure WSAsyncStart(Data:Pointer);
Description: To be documented


Winsock functions

[Expand]
function accept(s: TSocket; addr: PSockAddr; addrlen : ptOS_INT) : TSocket;
Description: To be documented


[Expand]
function accept(s: TSocket; addr: PSockAddr; var addrlen : tOS_INT) : TSocket;
Description: To be documented


[Expand]
function bind(s: TSocket; addr: PSockaddr; namelen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function bind(s: TSocket; var addr: TSockaddr; namelen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function closesocket(s: TSocket):tOS_INT;
Description: To be documented


[Expand]
function connect(s: TSocket; addr:PSockAddr; namelen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function connect(s: TSocket; var name:TSockAddr; namelen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function ioctlsocket(s: TSocket; cmd:longint; var arg:u_long):tOS_INT;
Description: To be documented


[Expand]
function ioctlsocket(s: TSocket; cmd:longint; var arg:longint):tOS_INT;
Description: To be documented


[Expand]
function ioctlsocket(s: TSocket; cmd:longint; argp:pu_long):tOS_INT;
Description: To be documented


[Expand]
function getpeername(s: TSocket; var name:TSockAddr; var namelen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function getsockname(s: TSocket; var name:TSockAddr; var namelen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function getsockopt(s: TSocket; level:tOS_INT; optname:tOS_INT; optval:pchar; var optlen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function getsockopt(s: TSocket; level:tOS_INT; optname:tOS_INT; optval:pointer; var optlen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function getsockopt(s: TSocket; level:tOS_INT; optname:tOS_INT; var optval; var optlen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function htonl(hostlong: u_long): u_long;
Description: To be documented


[Expand]
function htons(hostshort: u_short): u_short;
Description: To be documented


[Expand]
function inet_addr(cp: PChar): u_long;
Description: To be documented


[Expand]
function inet_ntoa(inaddr: TInAddr): PChar;
Description: To be documented


[Expand]
function listen(s: TSocket; backlog:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function ntohl(netlong: u_long): u_long;
Description: To be documented


[Expand]
function ntohs(netshort: u_short): u_short;
Description: To be documented


[Expand]
function recv(s: TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function recv(s: TSocket; buf:pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function recv(s: TSocket; var buf; len:tOS_INT; flags:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function recvfrom(s: TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT; from:PSockAddr; fromlen:ptOS_INT):tOS_INT;
Description: To be documented


[Expand]
function recvfrom(s: TSocket; buf:pointer; len:tOS_INT; flags:tOS_INT; from:PSockAddr; fromlen:ptOS_INT):tOS_INT;
Description: To be documented


[Expand]
function recvfrom(s: TSocket; var buf; len:tOS_INT; flags:tOS_INT; var from:TSockAddr; var fromlen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function select(nfds:tOS_INT; readfds,writefds,exceptfds : PFDSet;timeout: PTimeVal):tOS_INT;
Description: To be documented


[Expand]
function send(s: TSocket;var buf; len:tOS_INT; flags:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function send(s: TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function send(s: TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function sendto(s: TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT; toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function sendto(s: TSocket; buf:pointer; len:tOS_INT; flags:tOS_INT; toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function sendto(s: TSocket; var buf; len:tOS_INT; flags:tOS_INT; var toaddr:TSockAddr; tolen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function setsockopt(s: TSocket; level:tOS_INT; optname:tOS_INT; optval:pchar; optlen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function setsockopt(s: TSocket; level:tOS_INT; optname:tOS_INT; optval:pointer; optlen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function setsockopt(s: TSocket; level:tOS_INT; optname:tOS_INT; var optval; optlen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function shutdown(s: TSocket; how:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function socket(af:tOS_INT; struct:tOS_INT; protocol:tOS_INT):TSocket;
Description: To be documented


[Expand]
function gethostbyaddr(addr:pchar; len:tOS_INT; family:tOS_INT): PHostEnt;
Description: To be documented


[Expand]
function gethostbyname(name: PChar): PHostEnt;
Description: To be documented


[Expand]
function gethostname(name: PChar; namelen:tOS_INT):tOS_INT;
Description: To be documented


[Expand]
function getservbyport(port:tOS_INT; proto: PChar):PServEnt;
Description: To be documented


[Expand]
function getservbyname(name, proto: PChar): PServEnt;
Description: To be documented


[Expand]
function getprotobynumber(proto:tOS_INT):PProtoEnt;
Description: To be documented


[Expand]
function getprotobyname(name: PChar): PProtoEnt;
Description: To be documented


[Expand]
function WSAStartup(wVersionRequired:word; var WSAData:TWSADATA):tOS_INT;
Description: To be documented


[Expand]
function WSACleanup:tOS_INT;
Description: To be documented


[Expand]
procedure WSASetLastError(iError:tOS_INT);
Description: To be documented


[Expand]
function WSAGetLastError:tOS_INT;
Description: To be documented


[Expand]
function WSAIsBlocking: BOOL;
Description: To be documented


[Expand]
function WSAUnhookBlockingHook:tOS_INT;
Description: To be documented


[Expand]
function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc;
Description: To be documented


[Expand]
function WSACancelBlockingCall:tOS_INT;
Description: To be documented


[Expand]
function WSAAsyncGetServByName(hWnd:HWND; wMsg:u_int; name:pchar; proto:pchar; buf:pchar; buflen:tOS_INT):THandle;
Description: To be documented


[Expand]
function WSAAsyncGetServByPort(hWnd:HWND; wMsg:u_int; port:tOS_INT; proto:pchar; buf:pchar; buflen:tOS_INT):THandle;
Description: To be documented


[Expand]
function WSAAsyncGetProtoByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;
Description: To be documented


[Expand]
function WSAAsyncGetProtoByNumber(hWnd:HWND; wMsg:u_int; number:tOS_INT; buf:pchar; buflen:tOS_INT):THandle;
Description: To be documented


[Expand]
function WSAAsyncGetHostByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;
Description: To be documented


[Expand]
function WSAAsyncGetHostByAddr(hWnd:HWND; wMsg:u_int; addr:pchar; len:tOS_INT; family:tOS_INT; buf:pchar; buflen:tOS_INT):THandle;
Description: To be documented


[Expand]
function WSACancelAsyncRequest(hAsyncTaskHandle:THandle):tOS_INT;
Description: To be documented


[Expand]
function WSAAsyncSelect(s: TSocket; hWnd:HWND; wMsg:u_int; lEvent:longint):tOS_INT;
Description: To be documented


[Expand]
function WSARecvEx(s: TSocket;var buf; len:tOS_INT; flags:ptOS_INT):tOS_INT;
Description: To be documented


[Expand]
function __WSAFDIsSet(s: TSocket; var FDSet:TFDSet):Bool;
Description: To be documented


[Expand]
function __WSAFDIsSet_(s: TSocket; var FDSet:TFDSet):tOS_INT;
Description: To be documented


[Expand]
function TransmitFile(hSocket: TSocket; hFile: THandle; nNumberOfBytesToWrite: DWORD; nNumberOfBytesPerSend: DWORD; lpOverlapped: POverlapped; lpTransmitBuffers: PTransmitFileBuffers; dwReserved: DWORD): BOOL;
Description: To be documented


[Expand]
function AcceptEx(sListenSocket, sAcceptSocket: TSocket; lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; var lpdwBytesReceived: DWORD; lpOverlapped: POverlapped): BOOL;
Description: To be documented


[Expand]
procedure GetAcceptExSockaddrs(lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; var LocalSockaddr: TSockAddr; var LocalSockaddrLength: Integer; var RemoteSockaddr: TSockAddr; var RemoteSockaddrLength: Integer);
Description: To be documented


[Expand]
function WSAMakeSyncReply(Buflen,Error:Word):dword;
Description: To be documented


[Expand]
function WSAMakeSelectReply(Event,Error:Word):dword;
Description: To be documented


[Expand]
function WSAGetAsyncBuflen(Param:dword):Word;
Description: To be documented


[Expand]
function WSAGetAsyncError(Param:dword):Word;
Description: To be documented


[Expand]
function WSAGetSelectEvent(Param:dword):Word;
Description: To be documented


[Expand]
function WSAGetSelectError(Param:dword):Word;
Description: To be documented


[Expand]
procedure FD_CLR(Socket:TSocket; var FDSet:TFDSet);
Description: To be documented


[Expand]
function FD_ISSET(Socket:TSocket; var FDSet:TFDSet):Boolean;
Description: To be documented


[Expand]
procedure FD_SET(Socket:TSocket; var FDSet:TFDSet);
Description: To be documented


[Expand]
procedure FD_ZERO(var FDSet:TFDSet);
Description: To be documented


Winsock undocumented functions

[Expand]
function WsControl(Proto:DWORD; Action:DWORD; pRequestInfo:Pointer; var pcbRequestInfoLen:DWORD; pResponseInfo:Pointer; var pcbResponseInfoLen:DWORD):Integer;
Description: To be documented


[Expand]
function getnetbyaddr(addr: Pointer; len, Struct: Integer): PNetEnt;
Description: To be documented


[Expand]
function getnetbyname(name: PChar): PNetEnt;
Description: To be documented


Winsock enhanced functions

[Expand]
function WsControlEx(Proto:DWORD; Action:DWORD; pRequestInfo:Pointer; var pcbRequestInfoLen:DWORD; pResponseInfo:Pointer; var pcbResponseInfoLen:DWORD):Integer;
Description: To be documented


Winsock helper functions

[Expand]
function WinsockErrorToString(AError:LongInt):String;
Description: To be documented


Return to Unit Reference