Difference between revisions of "Unit Winsock"
From Ultibo.org
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '''Ultibo Winsock | + | '''Ultibo Winsock Interface unit''' |
''Notes:'' | ''Notes:'' | ||
Line 513: | Line 513: | ||
|colspan="2"| | |colspan="2"| | ||
|- | |- | ||
− | | <code>SO_DONTLINGER | + | | <code>SO_DONTLINGER = GlobalSock.SO_DONTLINGER;</code> |
+ | | | ||
+ | |- | ||
+ | | <code>SO_EXCLUSIVEADDRUSE = GlobalSock.SO_EXCLUSIVEADDRUSE;</code> | ||
| | | | ||
|- | |- | ||
Line 1,751: | Line 1,754: | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Address will be returned in network order |
|- | |- | ||
|} | |} | ||
Line 1,764: | Line 1,767: | ||
! Note | ! 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. | | 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. | ||
+ | |- | ||
+ | ! Note | ||
+ | | Address will be in network order | ||
|- | |- | ||
|} | |} | ||
Line 2,027: | Line 2,033: | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Address will be in network order where applicable |
|- | |- | ||
|} | |} | ||
Line 2,063: | Line 2,069: | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Port will be in network order |
|- | |- | ||
|} | |} | ||
Line 2,357: | Line 2,363: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure GetAcceptExSockaddrs(lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; var LocalSockaddr: | + | <pre style="border: 0; padding-bottom:0px;">procedure GetAcceptExSockaddrs(lpOutputBuffer: Pointer; dwReceiveDataLength, dwLocalAddressLength, dwRemoteAddressLength: DWORD; var LocalSockaddr: PSockAddr; var LocalSockaddrLength: Integer; var RemoteSockaddr: PSockAddr; var RemoteSockaddrLength: Integer);</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
Line 2,510: | Line 2,516: | ||
|- | |- | ||
! Note | ! Note | ||
− | | | + | | Address will be in network order where applicable |
|- | |- | ||
|} | |} |
Latest revision as of 05:36, 5 March 2025
Return to Unit Reference
Contents
[hide]Description
Ultibo Winsock 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
[Expand]
Winsock specific constants
WINSOCK_*
[Expand]
IP protocol
IPPROTO_*
[Expand]
IP port
IPPORT_*
[Expand]
IP option
IP_*
[Expand]
Socket type
SOCK_*
[Expand]
Socket option
SO_*
[Expand]
TCP option
TCP_*
[Expand]
UDP option
UDP_*
[Expand]
Address family
AF_*
[Expand]
Protocol family
PF_*
[Expand]
Message flag
MSG_*
[Expand]
WSAAsyncSelect flag
FD_*
[Expand]
Socket error
WSAE*
[Expand]
WsControlEx option
WSA_*
Type definitions
See globalsock.pas
Public variables
None defined
Function declarations
Initialization functions
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 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 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 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 WSAStartup(wVersionRequired:word; var WSAData:TWSADATA):tOS_INT;
Description: To be documented
[Expand]
function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc;
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):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: PSockAddr; var LocalSockaddrLength: Integer; var RemoteSockaddr: PSockAddr; var RemoteSockaddrLength: Integer);
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
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
RTL text IO functions
[Expand]
function SysTextIOReadChar(var ACh:Char; AUserData:Pointer):Boolean;
Description: Handler for platform TextIOReadChar function
[Expand]
function SysTextIOWriteChar(ACh:Char; AUserData:Pointer):Boolean;
Description: Handler for platform TextIOWriteChar function
[Expand]
function SysTextIOWriteBuffer(ABuffer:PChar; ACount:LongInt; AUserData:Pointer):LongInt;
Description: Handler for platform TextIOWriteBuffer function
Winsock helper functions
[Expand]
function WinsockRedirectInput(s:TSocket):Boolean;
Description: Redirect standard input to the socket specified by s
[Expand]
function WinsockRedirectOutput(s:TSocket):Boolean;
Description: Redirect standard output to the socket specified by s
Return to Unit Reference