winsock.h header

This header is used by Windows Sockets 2. For more information, see:

winsock.h contains the following programming interfaces:

Functions

 
__WSAFDIsSet

The __WSAFDIsSet function (winsock.h) specifies whether a socket is included in a set of socket descriptors.
AcceptEx

The AcceptEx function (winsock.h) accepts a new connection, returns the local and remote address, and receives the first block of data sent by the client application.
bind

The bind function (winsock.h) associates a local address with a socket.
closesocket

The closesocket function (winsock.h) closes an existing socket.
FD_SET

The FD_SET macro (winsock.h) is used by Windows Sockets (Winsock) functions and service providers to place sockets into a set.
GetAcceptExSockaddrs

The GetAcceptExSockaddrs function (winsock.h) parses the data obtained from a call to the AcceptEx function and passes the local and remote addresses to a sockaddr structure.
gethostbyaddr

As of Windows Sockets 2, the gethostbyaddr function (winsock.h) is no longer recommended for use.
gethostbyname

The gethostbyname function (winsock.h) retrieves host information corresponding to a host name from a host database.
gethostname

The gethostname function (winsock.h) retrieves the standard host name for the local computer.
getpeername

The getpeername function (winsock.h) retrieves the address of the peer to which a socket is connected.
getprotobyname

The getprotobyname function (winsock.h) retrieves the protocol information corresponding to a protocol name.
getprotobynumber

The getprotobynumber function (winsock.h) retrieves protocol information corresponding to a protocol number.
getservbyname

The getservbyname function (winsock.h) retrieves service information corresponding to a service name and protocol.
getservbyport

The getservbyport function (winsock.h) retrieves service information corresponding to a port and protocol.
getsockname

The getsockname function (winsock.h) retrieves the local name for a socket.
getsockopt

The getsockopt function (winsock.h) retrieves a socket option.
htonl

The htonl function (winsock.h) converts a u_long from host to TCP/IP network byte order (which is big-endian).
htons

The htons function (winsock.h) converts a u_short from host to TCP/IP network byte order (which is big-endian).
inet_addr

The inet_addr function (winsock.h) converts a string containing an IPv4 dotted-decimal address into a proper address for the IN_ADDR structure.
inet_ntoa

The inet_ntoa function (winsock.h) converts an (Ipv4) Internet network address into an ASCII string in Internet standard dotted-decimal format.
ioctlsocket

The ioctlsocket function (winsock.h) controls the I/O mode of a socket.
ntohl

The ntohl function (winsock.h) converts a u_long from TCP/IP network order to host byte order, which is little-endian on Intel processors.
ntohs

The ntohs function (winsock.h) converts a u_short from TCP/IP network byte order to host byte order, which is little-endian on Intel processors.
recv

The recv function (winsock.h) receives data from a connected socket or a bound connectionless socket.
recvfrom

The recvfrom function receives a datagram and stores the source address.
sendto

The sendto function (winsock.h) sends data to a specific destination.
setsockopt

The setsockopt function (winsock.h) sets a socket option.
shutdown

The shutdown function (winsock.h) disables sends or receives on a socket.
TransmitFile

The TransmitFile function (winsock.h) transmits file data over a connected socket handle.
WSAAsyncGetHostByAddr

The WSAAsyncGetHostByAddr function (winsock.h) asynchronously retrieves host information that corresponds to an address.
WSAAsyncGetHostByName

The WSAAsyncGetHostByName function (winsock.h) asynchronously retrieves host information that corresponds to a host name.
WSAAsyncGetProtoByName

The WSAAsyncGetProtoByName function (winsock.h) asynchronously retrieves protocol information that corresponds to a protocol name.
WSAAsyncGetProtoByNumber

The WSAAsyncGetProtoByNumber function (winsock.h) asynchronously retrieves protocol information that corresponds to a protocol number.
WSAAsyncGetServByName

The WSAAsyncGetServByName function (winsock.h) asynchronously retrieves service information that corresponds to a service name and port.
WSAAsyncGetServByPort

The WSAAsyncGetServByPort function (winsock.h) asynchronously retrieves service information that corresponds to a port and protocol.
WSAAsyncSelect

The WSAAsyncSelect function (winsock.h) requests Windows message-based notification of network events for a socket.
WSACancelAsyncRequest

The WSACancelAsyncRequest function (winsock.h) cancels an incomplete asynchronous operation.
WSACleanup

The WSACleanup function (winsock.h) terminates use of the WS2_32.dll.
WSAGetLastError

The WSAGetLastError function (winsock.h) returns the error status for the last Windows Sockets operation that failed.
WSARecvEx

The WSARecvEx function (winsock.h) receives data from a connected socket or a bound connectionless socket.
WSASetLastError

The WSASetLastError function (winsock.h) sets the error code that can be retrieved through the WSAGetLastError function.
WSAStartup

The WSAStartup function (winsock.h) initiates use of the Winsock DLL by a process.

Structures

 
fd_set

The fd_set structure (winsock.h) is used by Windows Sockets (Winsock) functions and service providers to place sockets into a set.
HOSTENT

The HOSTENT (winsock.h) structure is used by functions to store information about a given host, such as host name, IPv4 address, and so forth.
LINGER

The LINGER (winsock.h) structure maintains information about a specific socket that specifies how that socket should behave when data is queued to be sent.
PROTOENT

The PROTOENT (winsock.h) structure contains the name and protocol numbers that correspond to a given protocol name.
SERVENT

The SERVENT (winsock.h) structure is used to store or return the name and service number for a given service name.
SOCKADDR

The sockaddr structure varies depending on the protocol selected. (sockaddr)
SOCKADDR_IN

The SOCKADDR_IN (winsock.h) structure varies depending on the protocol selected.
TIMEVAL

The TIMEVAL (winsock.h) structure is used to specify a time interval. It is associated with the Berkeley Software Distribution (BSD) Time.h header file.
TRANSMIT_FILE_BUFFERS

The TRANSMIT_FILE_BUFFERS (winsock.h) structure specifies data to be transmitted before and after file data during a TransmitFile function file transfer operation.
WSADATA

The WSADATA (winsock.h) structure contains information about the Windows Sockets implementation.