Share via


Socket Functions (Compact 2013)

3/26/2014

This section discusses how the socket functions.

In This Section

  • 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.
  • 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
  • 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)
  • shutdown
    Disables sends or receives on a socket
  • gethostbyaddr (deprecated)
    Retrieves the host information corresponding to a network address

    Note

    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 database

    Note

    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.

See Also

Reference

Winsock Functions