Winsock API Reference

This section contains information on Winsock Compatibility Issues and a list of supported winsock API functions.

WinSock BSD API

Description

accept

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

bind

Assigns a local name to an unnamed socket.

closesocket

Removes a socket from the per-process object reference table. Only blocks if SO_LINGER is set with a nonzero time-out on a blocking socket.

connect

Initiates a connection on the specified socket.

freeaddrinfo

Frees address info returned by a call to freeaddrinfo.

getaddrinfo

Provides protocol independent translation from hostname to address.

gethostbyname

Retrieves host information corresponding to a host name from a host database on a DNS server.

gethostname

Returns an ASCII string that can be used with gethostbyname.

getnameinfo

Provides name resolution from an address to the host name.

getpeername

Retrieves the name of the peer connected to the specified socket.

getsockname

Retrieves the local address to which the specified socket is bound.

getsockopt

Retrieves options associated with the specified socket. RTX extends getsockopt with two additional options that apply at the IPPROTO_TCP level:

  • TCP_ACKDELAYTIME
    The delay period (in milliseconds) that the stack uses for delayed acknowledgements (ACKs). A value of zero indicates that delayed ACKs are disabled (that is, all data segments are acknowledged immediately). Default value is 200
  • TCP_ACKNSEG
    Acknowledgement frequency, configured to every Nth maximum-sized segment (MSS). The default for N is 2.

The IP_DONTFRAGMENT socket option, which is at the IPPROTO_IP level, has a default of 1 (fragmentation disabled).

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.

inet_addr

Converts a character string representing a number in the Internet standard ".'' notation to an Internet address value.

inet_ntoa

Converts an Internet address value to an ASCII string in ".'' notation i.e., "a.b.c.d''.

ioctlsocket

Provides 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 or unconnected socket.

recvfrom

Receives data from either a connected or unconnected socket.

select

Performs synchronous I/O multiplexing.

send

Sends data to a connected socket.

sendto

Sends data to either a connected or unconnected socket.

setsockopt

Stores options associated with the specified socket. RTX extends setsockopt with two additional options that apply at the IPPROTO_TCP level:

  • TCP_ACKDELAYTIME
    Specifies the delay period (in milliseconds) that the stack uses for delayed acknowledgements (ACKs). A value of zero disables delayed ACKs (that is, all data segments are acknowledged immediately). Default value is 200
  • TCP_ACKNSEG
    Acknowledgement frequency can be configured to every Nth maximum-sized segment (MSS) using this socket option. The default for N is 2.

The IP_DONTFRAGMENT socket option, which is at the IPPROTO_IP level, has a default of 1 (fragmentation disabled).

shutdown

Shuts down part of a full-duplex connection.

socket

Creates an endpoint for communication and return a socket descriptor.

WSAAccept

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

WSACleanup

Terminates use of the RT-TCP/IP stack within an RTSS process.

WSACloseEvent

Closes an open event object.

WSAConnect

Establishes a connection to a specified socket.

WSACreateEvent

Creates an event object internally with an initial state of nonsignaled.

WSAEventSelect

Specifies an event object to be associated with the specified set of FD_XXX network events.

WSAFDIsSet

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

WSAGetlastError

Gets the status for the last Winsock operation that failed.

WSAHtonl

Converts a u_long IPv4 address in host byte order to TCP/IP network byte order.

WSAHtons

Converts a u_short IPv4 address in host byte-ordering to TCP/IP network byte order.

WSAIoctl

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

WSANtohl

Converts a u_long in TCP/IP network byte order to host byte order.

WSANtohs

Converts a u_short in TCP/IP network byte order to host byte order.

WSARecv

Receives data on a socket and returns the number of bytes received.

WSARecvDisconnect

Causes a socket to be closed for receiving.

WSARecvFrom

Receives a datagram on a socket and returns the number of bytes received.

WSAResetEvent

Resets the state of the specified event object to non signaled.

WSASend

Transmits a message on a connected socket.

WSASendDisconnect

Causes a socket to be closed for sending.

WSASendTo

Transmits a message on a socket.

WSASetEvent

Sets the state of the specified event object to signaled.

WSASetLastError

Sets the error code which can be retrieved by WSAGetLastError call for the current thread.

WSASocket

Creates a socket and returns an integer descriptor.

WSAStartup

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

 

See Also

IntervalZero.com | Support | Give Feedback