Winsock Functions


Winsock Functions

The following list provides concise descriptions of each Winsock function. For additional information on any function, click the function name.

FunctionDescription
acceptPermits an incoming connection attempt on a socket.
AcceptExAccepts a new connection, returns the local and remote address, and receives the first block of data sent by the client application.
bindAssociates a local address with a socket.
closesocketCloses an existing socket.
connectEstablishes a connection to a specified socket.
ConnectExEstablishes a connection to a specified socket, and optionally sends data once the connection is established. Only supported on connection-oriented sockets.
DisconnectExCloses a connection on a socket, and allows the socket handle to be reused.
EnumProtocolsRetrieves information about a specified set of network protocols that are active on a local host.
freeaddrinfoFrees address information that the getaddrinfo function dynamically allocates in addrinfo structures.
FreeAddrInfoExFrees address information that the GetAddrInfoEx function dynamically allocates in addrinfoex structures.
FreeAddrInfoWFrees address information that the GetAddrInfoW function dynamically allocates in addrinfoW structures.
gai_strerrorAssists in printing error messages based on the EAI_* errors returned by the getaddrinfo function.
GetAcceptExSockaddrsParses the data obtained from a call to the AcceptEx function.
GetAddressByNameQueries a namespace, or a set of default namespaces, to retrieve network address information for a specified network service. This process is known as service name resolution. A network service can also use the function to obtain local address information that it can use with the bind function.
getaddrinfoProvides protocol-independent translation from an ANSI host name to an address.
GetAddrInfoExProvides protocol-independent name resolution with additional parameters to qualify which name space providers should handle the request.
GetAddrInfoWProvides protocol-independent translation from a Unicode host name to an address.
gethostbyaddrRetrieves the host information corresponding to a network address.
gethostbynameRetrieves host information corresponding to a host name from a host database. Deprecated: use getaddrinfo instead.
gethostnameRetrieves the standard host name for the local computer.
GetNameByTypeRetrieves the name of a network service for the specified service type.
getnameinfoProvides name resolution from an IPv4 or IPv6 address to an ANSI host name and from a port number to the ANSI service name.
GetNameInfoWProvides name resolution from an IPv4 or IPv6 address to a Unicode host name and from a port number to the Unicode service name.
getpeernameRetrieves the address of the peer to which a socket is connected.
getprotobynameRetrieves the protocol information corresponding to a protocol name.
getprotobynumberRetrieves protocol information corresponding to a protocol number.
getservbynameRetrieves service information corresponding to a service name and protocol.
getservbyportRetrieves service information corresponding to a port and protocol.
GetServiceRetrieves information about a network service in the context of a set of default namespaces or a specified namespace.
getsocknameRetrieves the local name for a socket.
getsockoptRetrieves a socket option.
GetTypeByNameRetrieves a service type GUID for a network service specified by name.
htonlConverts a u_long from host to TCP/IP network byte order (which is big-endian).
htonsConverts a u_short from host to TCP/IP network byte order (which is big-endian).
inet_addrConverts a string containing an (Ipv4) Internet Protocol dotted address into a proper address for the in_addr structure.
inet_ntoaConverts an (IPv4) Internet network address into a string in Internet standard dotted format.
InetNtopconverts an IPv4 or IPv6 Internet network address into a string in Internet standard format. The ANSI version of this function is inet_ntop.
InetPtonConverts an IPv4 or IPv6 Internet network address in its standard text presentation form into its numeric binary form. The ANSI version of this function is inet_pton.
ioctlsocketControls the I/O mode of a socket.
listenPlaces a socket a state where it is listening for an incoming connection.
ntohlConverts a u_long from TCP/IP network order to host byte order (which is little-endian on Intel processors).
ntohsConverts a u_short from TCP/IP network byte order to host byte order (which is little-endian on Intel processors).
recvReceives data from a connected or bound socket.
recvfromReceives a datagram and stores the source address.
selectDetermines the status of one or more sockets, waiting if necessary, to perform synchronous I/O.
sendSends data on a connected socket.
sendtoSends data to a specific destination.
SetAddrInfoExRegisters a host and service name along with associated addresses with a specific namespace provider.
SetServiceRegisters or removes from the registry a network service within one or more namespaces. Can also add or remove a network service type within one or more namespaces.
setsockoptSets a socket option.
shutdownDisables sends or receives on a socket.
socketCreates a socket that is bound to a specific service provider.
TransmitFileTransmits file data over a connected socket handle.
TransmitPacketsTransmits in-memory data or file data over a connected socket.
WSAAcceptConditionally accepts a connection based on the return value of a condition function, provides quality of service flow specifications, and allows the transfer of connection data.
WSAAddressToStringConverts all components of a sockaddr structure into a human-readable string representation of the address.
WSAAsyncGetHostByAddrAsynchronously retrieves host information that corresponds to an address.
WSAAsyncGetHostByNameAsynchronously retrieves host information that corresponds to a host name.
WSAAsyncGetProtoByNameAsynchronously retrieves protocol information that corresponds to a protocol name.
WSAAsyncGetProtoByNumberAsynchronously retrieves protocol information that corresponds to a protocol number.
WSAAsyncGetServByNameAsynchronously retrieves service information that corresponds to a service name and port.
WSAAsyncGetServByPortAsynchronously retrieves service information that corresponds to a port and protocol.
WSAAsyncSelectRequests Windows message-based notification of network events for a socket.
WSACancelAsyncRequestCancels an incomplete asynchronous operation.
WSACleanupTerminates use of the Ws2_32.DLL.
WSACloseEventCloses an open event object handle.
WSAConnectEstablishes a connection to another socket application, exchanges connect data, and specifies needed quality of service based on the specified FLOWSPEC structure.
WSAConnectByListEstablishes a connection to one out of a collection of possible endpoints represented by a set of destination addresses (host names and ports).
WSAConnectByNameEstablishes a connection to another socket application on a specified host and port
WSACreateEventCreates a new event object.
WSADeleteSocketPeerTargetNameRemoves the association between a peer target name and an IP address for a socket.
WSADuplicateSocketReturns a structure that can be used to create a new socket descriptor for a shared socket.
WSAEnumNameSpaceProvidersRetrieves information about available namespaces.
WSAEnumNameSpaceProvidersExRetrieves information about available namespaces.
WSAEnumNetworkEventsDiscovers occurrences of network events for the indicated socket, clear internal network event records, and reset event objects (optional).
WSAEnumProtocolsRetrieves information about available transport protocols.
WSAEventSelectSpecifies an event object to be associated with the specified set of FD_XXX network events.
__WSAFDIsSetSpecifies whether a socket is included in a set of socket descriptors.
WSAGetLastErrorReturns the error status for the last operation that failed.
WSAGetOverlappedResultRetrieves the results of an overlapped operation on the specified socket.
WSAGetQOSByNameInitializes a QOS structure based on a named template, or it supplies a buffer to retrieve an enumeration of the available template names.
WSAGetServiceClassInfoRetrieves the class information (schema) pertaining to a specified service class from a specified namespace provider.
WSAGetServiceClassNameByClassIdRetrieves the name of the service associated with the specified type.
WSAHtonlConverts a u_long from host byte order to network byte order.
WSAHtonsConverts a u_short from host byte order to network byte order.
WSAImpersonateSocketPeerUsed to impersonate the security principal corresponding to a socket peer in order to perform application-level authorization.
WSAInstallServiceClassRegisters a service class schema within a namespace.
WSAIoctlControls the mode of a socket.
WSAJoinLeafJoins a leaf node into a multipoint session, exchanges connect data, and specifies needed quality of service based on the specified structures.
WSALookupServiceBeginInitiates a client query that is constrained by the information contained within a WSAQUERYSET structure.
WSALookupServiceEndFrees the handle used by previous calls to WSALookupServiceBegin and WSALookupServiceNext.
WSALookupServiceNextRetrieve the requested service information.
WSANSPIoctlDevelopers to make I/O control calls to a registered namespace.
WSANtohlConverts a u_long from network byte order to host byte order.
WSANtohsConverts a u_short from network byte order to host byte order.
WSAPollDetermines status of one or more sockets.
WSAProviderConfigChangeNotifies the application when the provider configuration is changed.
WSAQuerySocketSecurityQueries information about the security applied to a connection on a socket.
WSARecvReceives data from a connected socket.
WSARecvDisconnectTerminates reception on a socket, and retrieves the disconnect data if the socket is connection oriented.
WSARecvExReceives data from a connected socket.
WSARecvFromReceives a datagram and stores the source address.
WSARecvMsgReceives data and optional control information from connected and unconnected sockets.
WSARemoveServiceClassPermanently removes the service class schema from the registry.
WSAResetEventResets the state of the specified event object to nonsignaled.
WSARevertImpersonationTerminates the impersonation of a socket peer.
WSASendSends data on a connected socket.
WSASendDisconnectInitiates termination of the connection for the socket and sends disconnect data.
WSASendMsgSends data and optional control information from connected and unconnected sockets.
WSASendToSends data to a specific destination, using overlapped I/O where applicable.
WSASetEventSets the state of the specified event object to signaled.
WSASetLastErrorSets the error code.
WSASetServiceRegisters or removes from the registry a service instance within one or more namespaces.
WSASetSocketPeerTargetNameUsed to specify the peer target name (SPN) that corresponds to a peer IP address. This target name is meant to be specified by client applications to securely identify the peer that should be authenticated.
WSASetSocketSecurityEnables and applies security for a socket.
WSASocketCreates a socket that is bound to a specific transport-service provider.
WSAStartupInitiates use of WS2_32.DLL by a process.
WSAStringToAddressConverts a numeric string to a sockaddr structure.
WSAWaitForMultipleEventsReturns either when one or all of the specified event objects are in the signaled state, or when the time-out interval expires.

 

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags :


Page view tracker