winsock.h header

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

Functions

Title Description
__WSAFDIsSet The __WSAFDIsSet function specifies whether a socket is included in a set of socket descriptors.
AcceptEx Accepts a new connection, returns the local and remote address, and receives the first block of data sent by the client application. Note  This function is a Microsoft-specific extension to the Windows Sockets specification. .
bind The bind function associates a local address with a socket.
closesocket The closesocket function closes an existing socket.
FD_SET Fd_set structure is used by Windows Sockets (Winsock) functions and service providers to place sockets into a set.
GetAcceptExSockaddrs Parses the data obtained from a call to the AcceptEx function and passes the local and remote addresses to a sockaddr structure.Note  This function is a Microsoft-specific extension to the Windows Sockets specification. .
gethostbyaddr gethostbyaddr is no longer recommended for use as of Windows Sockets 2.
gethostbyname The gethostbyname function retrieves host information corresponding to a host name from a host database.
gethostname The gethostname function retrieves the standard host name for the local computer.
getpeername The getpeername function retrieves the address of the peer to which a socket is connected.
getprotobyname The getprotobyname function retrieves the protocol information corresponding to a protocol name.
getprotobynumber The getprotobynumber function retrieves protocol information corresponding to a protocol number.
getservbyname The getservbyname function retrieves service information corresponding to a service name and protocol.
getservbyport The getservbyport function retrieves service information corresponding to a port and protocol.
getsockname The getsockname function retrieves the local name for a socket.
getsockopt The getsockopt function retrieves a socket option.
htonl The htonl function converts a u_long from host to TCP/IP network byte order (which is big-endian).
htons The htons function converts a u_short from host to TCP/IP network byte order (which is big-endian).
inet_addr The inet_addr function converts a string containing an IPv4 dotted-decimal address into a proper address for the IN_ADDR structure.
inet_ntoa The inet_ntoa function converts an (Ipv4) Internet network address into an ASCII string in Internet standard dotted-decimal format.
ioctlsocket The ioctlsocket function controls the I/O mode of a socket.
ntohl The ntohl function converts a u_long from TCP/IP network order to host byte order (which is little-endian on Intel processors).
ntohs 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 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 sends data to a specific destination.
setsockopt Sets a socket option.
shutdown The shutdown function disables sends or receives on a socket.
TransmitFile Transmits file data over a connected socket handle.
WSAAsyncGetHostByAddr The WSAAsyncGetHostByAddr function asynchronously retrieves host information that corresponds to an address.Note  The WSAAsyncGetHostByAddr function is not designed to provide parallel resolution of several addresses.
WSAAsyncGetHostByName The WSAAsyncGetHostByName function asynchronously retrieves host information that corresponds to a host name.Note  The WSAAsyncGetHostByName function is not designed to provide parallel resolution of several names.
WSAAsyncGetProtoByName The WSAAsyncGetProtoByName function asynchronously retrieves protocol information that corresponds to a protocol name.
WSAAsyncGetProtoByNumber The WSAAsyncGetProtoByNumber function asynchronously retrieves protocol information that corresponds to a protocol number.
WSAAsyncGetServByName The WSAAsyncGetServByName function asynchronously retrieves service information that corresponds to a service name and port.
WSAAsyncGetServByPort The WSAAsyncGetServByPort function asynchronously retrieves service information that corresponds to a port and protocol.
WSAAsyncSelect Requests Windows message-based notification of network events for a socket.
WSACancelAsyncRequest The WSACancelAsyncRequest function cancels an incomplete asynchronous operation.
WSACleanup The WSACleanup function terminates use of the WS2_32.dll.
WSAGetLastError Returns the error status for the last Windows Sockets operation that failed.
WSARecvEx Receives data from a connected socket or a bound connectionless socket.
WSASetLastError The WSASetLastError function sets the error code that can be retrieved through the WSAGetLastError function.
WSAStartup Initiates use of the Winsock DLL by a process.

Structures

Title Description
fd_set Fd_set structure is used by Windows Sockets (Winsock) functions and service providers to place sockets into a set.
HOSTENT The hostent structure is used by functions to store information about a given host, such as host name, IPv4 address, and so forth.
LINGER Maintains information about a specific socket that specifies how that socket should behave when data is queued to be sent and the closesocket function is called on the socket.
PROTOENT The protoent structure contains the name and protocol numbers that correspond to a given protocol name.
SERVENT The servent 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_IN The sockaddr structure varies depending on the protocol selected.
TIMEVAL The timeval 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 structure specifies data to be transmitted before and after file data during a TransmitFile function file transfer operation.
WSADATA Contains information about the Windows Sockets implementation.