Socket Functions (Compact 2013)
3/26/2014
This section discusses how the socket functions.
In This Section
- accept (Windows Sockets)
Permits an incoming connection attempt on a socket
- bind (Windows Sockets)
Associates a local address with a socket
- closesocket
Closes an existing socket
- connect (Windows Sockets)
This function establishes a connection to a specified socket
- freeaddrinfo
Frees address information that the getaddrinfo function dynamically allocates in its addrinfo structures
- getaddrinfo
Provides protocol-independent translation from host name to address
- gethostname
This function returns the standard host name for the local machine
- getnameinfo
Provides name resolution from an address to the host name.
- getpeername (Windows Sockets)
Retrieves the name of the peer to which a socket is connected
- getsockname (Windows Sockets)
Retrieves the local name for a socket
- getsockopt (Windows Sockets)
Retrieves a socket option
- htonl
Converts a u_long from host to TCP/IP network byte order, which is big-endian
- htons
Converts a u_short from host to TCP/IP network byte order, which is big-endian
- inet_addr
Converts a string containing an (Ipv4) Internet Protocol dotted address into a proper address for the in_addr structure
- inet_ntoa
Converts an (Ipv4) Internet network address into a string in Internet standard dotted format
- ioctlsocket
Controls the I/O mode of a socket
- listen
Places a socket at a state where it is listening for an incoming connection
- ntohl
Converts a u_long from TCP/IP network order to host byte order, which is little-endian on Intel processors
- ntohs
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
- recvfrom
Receives a datagram and stores the source address
- select
Determines the status of one or more sockets, waiting if necessary, to perform synchronous I/O
- send
Sends data on a connected socket
- sendto
Sends data to a specific destination
- sethostname
Used to register the host name on a network with the Windows Internet Naming Service (WINS)
- setsockopt (Windows Sockets)
Sets a socket option
- shutdown
Disables sends or receives on a socket
- socket (Windows Sockets)
Creates a socket that is bound to a specific service provider
gethostbyaddr (deprecated)
Retrieves the host information corresponding to a network addressNote
The gethostbyaddr function has been deprecated by the introduction of the getnameinfo function. Developers who create Windows Sockets 2 applications are urged to use the getnameinfo function instead of the gethostbyaddr function.
gethostbyname (deprecated)
Retrieves host information corresponding to a host name from a host databaseNote
The gethostbyname function has been deprecated by the introduction of the getaddrinfo function. Developers who create Windows Sockets 2 applications are urged to use the getaddrinfo function instead of gethostbyname.