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(int s, Pointer<SOCKADDR> addr, Pointer<Int32> addrlen) int winsock
The accept function permits an incoming connection attempt on a socket.
bind(int s, Pointer<SOCKADDR> name, int namelen) int winsock
The bind function associates a local address with a socket.
closesocket(int s) int winsock
The closesocket function closes an existing socket.
connect(int s, Pointer<SOCKADDR> name, int namelen) int winsock
The connect function establishes a connection to a specified socket.
GetAddrInfo(Pointer<Utf16> pNodeName, Pointer<Utf16> pServiceName, Pointer<addrinfo> pHints, Pointer<Pointer<addrinfo>> ppResult) int winsock
The GetAddrInfoW function provides protocol-independent translation from a Unicode host name to an address.
gethostbyaddr(Pointer<Utf8> addr, int len, int type) Pointer<hostent> winsock
The gethostbyaddr function retrieves the host information corresponding to a network address.
gethostbyname(Pointer<Utf8> name) Pointer<hostent> winsock
The gethostbyname function retrieves host information corresponding to a host name from a host database.
gethostname(Pointer<Utf8> name, int namelen) int winsock
The gethostname function retrieves the standard host name for the local computer.
getnameinfo(Pointer<SOCKADDR> pSockaddr, int SockaddrLength, Pointer<Utf8> pNodeBuffer, int NodeBufferSize, Pointer<Utf8> pServiceBuffer, int ServiceBufferSize, int Flags) int winsock
The getnameinfo function provides protocol-independent name resolution from an address to an ANSI host name and from a port number to the ANSI service name.
getpeername(int s, Pointer<SOCKADDR> name, Pointer<Int32> namelen) int winsock
The getpeername function retrieves the address of the peer to which a socket is connected.
getprotobyname(Pointer<Utf8> name) Pointer<protoent> winsock
The getprotobyname function retrieves the protocol information corresponding to a protocol name.
getprotobynumber(int number) Pointer<protoent> winsock
The getprotobynumber function retrieves protocol information corresponding to a protocol number.
getservbyname(Pointer<Utf8> name, Pointer<Utf8> proto) Pointer<servent> winsock
The getservbyname function retrieves service information corresponding to a service name and protocol.
getservbyport(int port, Pointer<Utf8> proto) Pointer<servent> winsock
The getservbyport function retrieves service information corresponding to a port and protocol.
getsockname(int s, Pointer<SOCKADDR> name, Pointer<Int32> namelen) int winsock
The getsockname function retrieves the local name for a socket.
getsockopt(int s, int level, int optname, Pointer<Utf8> optval, Pointer<Int32> optlen) int winsock
The getsockopt function retrieves a socket option.
htonl(int hostlong) int winsock
The htonl function converts a u_long from host to TCP/IP network byte order (which is big-endian).
htons(int hostshort) int winsock
The htons function converts a u_short from host to TCP/IP network byte order (which is big-endian).
inet_addr(Pointer<Utf8> cp) int winsock
The inet_addr function converts a string containing an IPv4 dotted-decimal address into a proper address for the IN_ADDR structure.
inet_ntoa(IN_ADDR $in) Pointer<Utf8> winsock
The inet_ntoa function converts an (Ipv4) Internet network address into an ASCII string in Internet standard dotted-decimal format.
ioctlsocket(int s, int cmd, Pointer<Uint32> argp) int winsock
The ioctlsocket function controls the I/O mode of a socket.
listen(int s, int backlog) int winsock
The listen function places a socket in a state in which it is listening for an incoming connection.
ntohl(int netlong) int winsock
The ntohl function converts a u_long from TCP/IP network order to host byte order (which is little-endian on Intel processors).
ntohs(int netshort) int winsock
The ntohs function converts a u_short from TCP/IP network byte order to host byte order (which is little-endian on Intel processors).
recv(int s, Pointer<Utf8> buf, int len, int flags) int winsock
The recv function receives data from a connected socket or a bound connectionless socket.
recvfrom(int s, Pointer<Utf8> buf, int len, int flags, Pointer<SOCKADDR> from, Pointer<Int32> fromlen) int winsock
The recvfrom function receives a datagram, and stores the source address.
select(int nfds, Pointer<fd_set> readfds, Pointer<fd_set> writefds, Pointer<fd_set> exceptfds, Pointer<timeval> timeout) int winsock
The select function determines the status of one or more sockets, waiting if necessary, to perform synchronous I/O.
send(int s, Pointer<Utf8> buf, int len, int flags) int winsock
The send function sends data on a connected socket.
sendto(int s, Pointer<Utf8> buf, int len, int flags, Pointer<SOCKADDR> to, int tolen) int winsock
The sendto function sends data to a specific destination.
shutdown(int s, int how) int winsock
The shutdown function disables sends or receives on a socket.
socket(int af, int type, int protocol) int winsock
The socket function creates a socket that is bound to a specific transport service provider.