winsock topic
Windows Socket Library
Windows Sockets 2 (Winsock) enables programmers to create advanced Internet, intranet, and other network-capable applications to transmit application data across the wire, independent of the network protocol being used. With Winsock, programmers are provided access to Windows networking capabilities such as multicast and Quality of Service (QoS).
Functions
-
accept(
SOCKET s, Pointer< winsockSOCKADDR> ? addr, Pointer<Int32> ? addrlen) → Win32Result<SOCKET> - Permits an incoming connection attempt on a socket.
-
bind(
SOCKET s, Pointer< winsockSOCKADDR> name, int namelen) → Win32Result<int> - Associates a local address with a socket.
-
closesocket(
SOCKET s) → Win32Result< winsockint> - Closes an existing socket.
-
connect(
SOCKET s, Pointer< winsockSOCKADDR> name, int namelen) → Win32Result<int> - Establishes a connection to a specified socket.
-
GetAddrInfo(
PCWSTR? pNodeName, PCWSTR? pServiceName, Pointer< winsockADDRINFO> ? pHints, Pointer<Pointer< ppResult) → intADDRINFO> > - Provides protocol-independent translation from a Unicode host name to an address.
-
gethostname(
PSTR name, int namelen) → Win32Result< winsockint> - Retrieves the standard host name for the local computer.
-
getnameinfo(
Pointer< winsockSOCKADDR> pSockaddr, socklen_t sockaddrLength, PSTR? pNodeBuffer, int nodeBufferSize, PSTR? pServiceBuffer, int serviceBufferSize, int flags) → Win32Result<int> - Provides protocol-independent name resolution from an address to an ANSI host name and from a port number to the ANSI service name.
-
getpeername(
SOCKET s, Pointer< winsockSOCKADDR> name, Pointer<Int32> namelen) → Win32Result<int> - Retrieves the address of the peer to which a socket is connected.
-
getprotobyname(
PCSTR name) → Win32Result< winsockPointer< PROTOENT> > - Retrieves the protocol information corresponding to a protocol name.
-
getprotobynumber(
int number) → Win32Result< winsockPointer< PROTOENT> > - Retrieves protocol information corresponding to a protocol number.
-
getservbyname(
PCSTR name, PCSTR? proto) → Win32Result< winsockPointer< SERVENT> > - Retrieves service information corresponding to a service name and protocol.
-
getservbyport(
int port, PCSTR? proto) → Win32Result< winsockPointer< SERVENT> > - Retrieves service information corresponding to a port and protocol.
-
getsockname(
SOCKET s, Pointer< winsockSOCKADDR> name, Pointer<Int32> namelen) → Win32Result<int> - Retrieves the local name for a socket.
-
getsockopt(
SOCKET s, int level, int optname, PSTR optval, Pointer< winsockInt32> optlen) → Win32Result<int> - Retrieves a socket option.
-
htonl(
int hostlong) → Win32Result< winsockint> - Converts a u_long from host to TCP/IP network byte order (which is big-endian).
-
htons(
int hostshort) → Win32Result< winsockint> - Converts a u_short from host to TCP/IP network byte order (which is big-endian).
-
inet_ntop(
int family, Pointer< winsockNativeType> pAddr, PSTR pStringBuf, int stringBufSize) → Win32Result<PCSTR> - Converts an IPv4 or IPv6 Internet network address into a string in Internet standard format.
-
ioctlsocket(
SOCKET s, int cmd, Pointer< winsockUint32> argp) → Win32Result<int> - Controls the I/O mode of a socket.
-
listen(
SOCKET s, int backlog) → Win32Result< winsockint> - Places a socket in a state in which it is listening for an incoming connection.
-
ntohl(
int netlong) → Win32Result< winsockint> - Converts a u_long from TCP/IP network order to host byte order, which is little-endian on Intel processors.
-
ntohs(
int netshort) → Win32Result< winsockint> - Converts a u_short from TCP/IP network byte order to host byte order, which is little-endian on Intel processors.
-
recv(
SOCKET s, PSTR buf, int len, SEND_RECV_FLAGS flags) → Win32Result< winsockint> - Receives data from a connected socket or a bound connectionless socket.
-
recvfrom(
SOCKET s, PSTR buf, int len, int flags, Pointer< winsockSOCKADDR> ? from, Pointer<Int32> ? fromlen) → Win32Result<int> - Receives a datagram and stores the source address.
-
select(
int nfds, Pointer< winsockFD_SET> ? readfds, Pointer<FD_SET> ? writefds, Pointer<FD_SET> ? exceptfds, Pointer<TIMEVAL> ? timeout) → Win32Result<int> - Determines the status of one or more sockets, waiting if necessary, to perform synchronous I/O.
-
send(
SOCKET s, PCSTR buf, int len, SEND_RECV_FLAGS flags) → Win32Result< winsockint> - Sends data on a connected socket.
-
sendto(
SOCKET s, PCSTR buf, int len, int flags, Pointer< winsockSOCKADDR> to, int tolen) → Win32Result<int> - Sends data to a specific destination.
-
shutdown(
SOCKET s, WINSOCK_SHUTDOWN_HOW how) → Win32Result< winsockint> - Disables sends or receives on a socket.
-
socket(
int af, WINSOCK_SOCKET_TYPE type, int protocol) → Win32Result< winsockSOCKET> - Creates a socket that is bound to a specific transport service provider.