Winsock API Reference

The supported Winsock API functions are listed below.

Winsock BSD API

Description

accept

Returns a new socket that corresponds to an established connection from the listening socket queue.

bind

Assigns a local IP address and port to an unnamed socket.

closesocket

Closes (removes) a socket created by socket or returned by accept. If a socket is connected, closesocket closes the connection first.

connect

Initiates a connection on the specified socket. For a connectionless protocol, it restricts communications to one peer instead of establishing a connection.

freeaddrinfo

Frees address information dynamically allocated by getaddrinfo.

getaddrinfo

Provides protocol-independent translation from a hostname to an IP address.

gethostname

Returns an ASCII string representation of the first IPv4 address configured on a system.

getnameinfo

Provides name resolution from an address to the hostname.

getpeername

Retrieves the IP address and port of the peer connected to the specified socket.

getsockname

Retrieves the local IP address and port to which the specified socket is bound.

getsockopt

Retrieves an option associated with the specified socket.

htonl

Converts a 32-bit quantity from host byte order to network byte order.

htons

Converts a 16-bit quantity from host byte order to network byte order.

if_indextoname

Converts the local index for a network interface to the ANSI interface name.

if_nametoindex

Converts the ANSI interface name for a network interface to a local index for the interface.

inet_addr

Converts an ASCII string containing a standard dotted-decimal address to a binary IPv4 address in network byte order.

inet_ntoa

Converts a binary IPv4 address in network byte order to an ASCII string in standard dotted-decimal format.

inet_ntop

Converts an IPv4 or IPv6 Internet network address in network byte order to an ASCII string in Internet standard text presentation.

inet_pton

Converts an ASCII string of IPv4 or IPv6 Internet network address in its standard text presentation form into its numeric binary form in network byte order.

ioctlsocket

Provides I/O control for sockets.

listen

Listens for incoming connections on a specified socket.

ntohl

Converts a 32-bit quantity from network byte order to host byte order.

ntohs

Converts a 16-bit quantity from network byte order to host byte order.

recv

Receives data from a connected socket.

recvfrom

Receives a message on a non-TCP socket.

select

Performs synchronous I/O multiplexing.

send

Sends data on a connected socket.

sendto

Transmits a message on a non-connected non-TCP socket.

setsockopt

Stores options associated with the specified socket.

shutdown

Shuts down part or all of a full-duplex connection.

socket

Creates an endpoint for communication and returns a socket descriptor.

WSACleanup

Terminates the use of the TCP/IP Stack within an RTSS process.

WSAFDIsSet

Checks whether a socket is included in a set of socket descriptors.

WSAGetlastError

Gets the status for the last Winsock operation that failed.

WSAHtonl

Converts a 32-bit quantity in host byte order to network byte order.

WSAHtons

Converts a 16-bit quantity in host byte order to network byte order.

WSAIoctl

Performs a protocol specific I/O control action on the socket in any state.

WSANtohl

Converts a 32-bit quantity in network byte order to host byte order.

WSANtohs

Converts a 16-bit quantity in network byte order to host byte order.

WSASetLastError

Sets the error code that WSAGetLastError can retrieve for the current thread.

WSAStartup

Initiates the use of TCP/IP by an RTSS process.

See Also: