Unit Winsock2

From Ultibo.org
Revision as of 05:34, 19 December 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


Ultibo Winsock2 interface unit

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

procedure WS2Init;
Description: To be documented
Note None documented


function WS2Start:Boolean;
Description: To be documented
Note None documented


function WS2Stop:Boolean;
Description: To be documented
Note None documented


procedure WS2AsyncStart(Data:Pointer);
Description: To be documented
Note None documented


Winsock2 functions

function accept( const s: TSocket; addr: PSockAddr; addrlen: PLongint ): TSocket;
Description: To be documented
Note None documented


function accept( const s: TSocket; addr: PSockAddr; var addrlen: Longint ): TSocket;
Description: To be documented
Note None documented


function bind( const s: TSocket; addr: PSockAddr; namelen: Longint ): Longint;
Description: To be documented
Note None documented


function bind( const s: TSocket; var addr: TSockAddr; namelen: Longint ): Longint;
Description: To be documented
Note None documented


function closesocket( const s: TSocket ): Longint;
Description: To be documented
Note None documented


function connect( const s: TSocket; name: PSockAddr; namelen: Longint): Longint;
Description: To be documented
Note None documented


function connect( const s: TSocket; var name: TSockAddr; namelen: Longint): Longint;
Description: To be documented
Note None documented


function ioctlsocket( const s: TSocket; cmd: Longint; var arg: u_long ): Longint;
Description: To be documented
Note None documented


function ioctlsocket( const s: TSocket; cmd: Longint; argp: pu_long ): Longint;
Description: To be documented
Note None documented


function getpeername( const s: TSocket; var name: TSockAddr; var namelen: Longint ): Longint;
Description: To be documented
Note None documented


function getsockname( const s: TSocket; var name: TSockAddr; var namelen: Longint ): Longint;
Description: To be documented
Note None documented


function getsockopt( const s: TSocket; const level, optname: Longint; optval: PChar; var optlen: Longint ): Longint;
Description: To be documented
Note None documented


function getsockopt( const s: TSocket; const level, optname: Longint; optval: Pointer; var optlen: Longint ): Longint;
Description: To be documented
Note None documented


function getsockopt( const s: TSocket; const level, optname: Longint; var optval; var optlen: Longint ): Longint;
Description: To be documented
Note None documented


function htonl(hostlong: u_long): u_long;
Description: To be documented
Note None documented


function htons(hostshort: u_short): u_short;
Description: To be documented
Note None documented


function inet_addr(cp: PChar): u_long;
Description: To be documented
Note None documented


function inet_ntoa(inaddr: TInAddr): PChar;
Description: To be documented
Note As per the Winsock specification, the buffer returned by this function is only guaranteed to be valid until the next Winsock function call is made within the same thread. Therefore, the data should be copied before another Winsock call.


function listen(s: TSocket; backlog: Longint): Longint;
Description: To be documented
Note None documented


function ntohl(netlong: u_long): u_long;
Description: To be documented
Note None documented


function ntohs(netshort: u_short): u_short;
Description: To be documented
Note None documented


function recv(s: TSocket; var Buf; len, flags: Longint): Longint;
Description: To be documented
Note None documented


function recv(s: TSocket; Buf: PChar; len, flags: Longint): Longint;
Description: To be documented
Note None documented


function recv(s: TSocket; Buf: Pointer; len, flags: Longint): Longint;
Description: To be documented
Note None documented


function recvfrom(s: TSocket; Buf: PChar; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint;
Description: To be documented
Note None documented


function recvfrom(s: TSocket; Buf: Pointer; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint;
Description: To be documented
Note None documented


function recvfrom(s: TSocket; var Buf; len, flags: Longint; var from: TSockAddr; var fromlen: Longint): Longint;
Description: To be documented
Note None documented


function select(nfds: Longint; readfds, writefds, exceptfds: PFDSet; timeout: PTimeVal): Longint;
Description: To be documented
Note All sockets contained in the FSSet must by of the same type


function send(s: TSocket; var Buf; len, flags: Longint): Longint;
Description: To be documented
Note None documented


function send(s: TSocket; Buf: PChar; len, flags: Longint): Longint;
Description: To be documented
Note None documented


function send(s: TSocket; Buf: Pointer; len, flags: Longint): Longint;
Description: To be documented
Note None documented


function sendto(s: TSocket; var Buf; len, flags: Longint; var addrto: TSockAddr; tolen: Longint): Longint;
Description: To be documented
Note None documented


function sendto(s: TSocket; Buf: PChar; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint;
Description: To be documented
Note None documented


function sendto(s: TSocket; Buf: Pointer; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint;
Description: To be documented
Note None documented


function setsockopt(s: TSocket; level, optname: Longint; const optval; optlen: Longint): Longint;
Description: To be documented
Note None documented


function setsockopt(s: TSocket; level, optname: Longint; optval: PChar; optlen: Longint): Longint;
Description: To be documented
Note None documented


function setsockopt(s: TSocket; level, optname: Longint; optval: Pointer; optlen: Longint): Longint;
Description: To be documented
Note None documented


function shutdown(s: TSocket; how: Longint): Longint;
Description: To be documented
Note None documented


function socket(af, struct, protocol: Longint): TSocket;
Description: To be documented
Note None documented


function gethostbyaddr(addr: Pointer; len, family: Longint): PHostEnt;
Description: To be documented
Note None documented


function gethostbyname(name: PChar): PHostEnt;
Description: To be documented
Note None documented


function gethostname(name: PChar; len: Longint): Longint;
Description: To be documented
Note None documented


function getservbyport(port: Longint; proto: PChar): PServEnt;
Description: To be documented
Note None documented


function getservbyname(name, proto: PChar): PServEnt;
Description: To be documented
Note None documented


function getprotobynumber(proto: Longint): PProtoEnt;
Description: To be documented
Note None documented


function getprotobyname(name: PChar): PProtoEnt;
Description: To be documented
Note None documented


function getaddrinfo(pNodeName, pServiceName: PChar; pHints: PAddrInfo; var ppResult: PAddrInfo): LongInt;
Description: To be documented
Note None documented


procedure freeaddrinfo(ai: PAddrInfo);
Description: To be documented
Note None documented


function getnameinfo(sa: PSockAddr; salen: Integer; host: PChar; hostlen: DWORD; serv: PChar; servlen: DWORD; flags: Integer): Integer;
Description: To be documented
Note None documented


function WSAStartup(wVersionRequired: word; var WSData: TWSAData): Longint;
Description: To be documented
Note None documented


function WSACleanup: Longint;
Description: To be documented
Note None documented


procedure WSASetLastError(iError: Longint);
Description: To be documented
Note None documented


function WSAGetLastError: Longint;
Description: To be documented
Note None documented


function __WSAFDIsSet(s: TSOcket; var FDSet: TFDSet): Bool;
Description: To be documented
Note None documented


function inet_pton(Family: Longint; pszAddrString: PChar; pAddrBuf: Pointer): Longint;
Description: To be documented
Note None documented


function InetPtonA(Family: Longint; pszAddrString: PChar; pAddrBuf: Pointer): Longint;
Description: To be documented
Note None documented


function InetPtonW(Family: Longint; pszAddrString: PWideChar; pAddrBuf: Pointer): Longint;
Description: To be documented
Note None documented


function inet_ntop(Family: Longint; pAddr: Pointer; pStringBuf: PChar; StringBufSize: Longint): PChar;
Description: To be documented
Note None documented


function InetNtopA(Family: Longint; pAddr: Pointer; pStringBuf: PChar; StringBufSize: Longint): PChar;
Description: To be documented
Note None documented


function InetNtopW(Family: Longint; pAddr: Pointer; pStringBuf: PWideChar; StringBufSize: Longint): PWideChar;
Description: To be documented
Note None documented


function WSAhtonl( s : TSocket; hostlong : u_long; var lpnetlong : DWORD ): Longint;
Description: To be documented
Note None documented


function WSAhtons( s : TSocket; hostshort : u_short; var lpnetshort : WORD ): Longint;
Description: To be documented
Note None documented


function WSANtohl( s : TSocket; netlong : u_long; var lphostlong : DWORD ): Longint;
Description: To be documented
Note None documented


function WSANtohs( s : TSocket; netshort : u_short; var lphostshort : WORD ): Longint;
Description: To be documented
Note None documented


function WSAMakeSyncReply(Buflen, Error: Word): Longint;
Description: To be documented
Note None documented


function WSAMakeSelectReply(Event, Error: Word): Longint;
Description: To be documented
Note None documented


function WSAGetAsyncBuflen(Param: Longint): Word;
Description: To be documented
Note None documented


function WSAGetAsyncError(Param: Longint): Word;
Description: To be documented
Note None documented


function WSAGetSelectEvent(Param: Longint): Word;
Description: To be documented
Note None documented


function WSAGetSelectError(Param: Longint): Word;
Description: To be documented
Note None documented


procedure FD_CLR(Socket: TSocket; var FDSet: TFDSet);
Description: To be documented
Note None documented


function FD_ISSET(Socket: TSocket; var FDSet: TFDSet): Boolean;
Description: To be documented
Note None documented


procedure FD_SET(Socket: TSocket; var FDSet: TFDSet);
Description: To be documented
Note None documented


procedure FD_ZERO(var FDSet: TFDSet);
Description: To be documented
Note None documented


Winsock2 undocumented functions

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


function getnetbyaddr(addr: Pointer; len, Struct: Integer): PNetEnt;
Description: To be documented
Note None documented


function getnetbyname(name: PChar): PNetEnt;
Description: To be documented
Note None documented


Winsock2 enhanced functions

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


Return to Unit Reference