Socket Functions

The Windows Sockets specification includes the following Berkeley-style socket routines:

accept() An incoming connection is acknowledged and associated with an immediately created socket. The original socket is returned to the listening state.

bind() Assign a local name to an unnamed socket.

closesocket() Remove a socket descriptor from the per-process object reference table. Only blocks if SO_LINGER is set.

connect() Initiate a connection on the specified socket.

getpeername() Retrieve the name of the peer connected to the specified socket descriptor.

getsockname() Retrieve the current name for the specified socket

getsockopt() Retrieve options associated with the specified socket descriptor.

htonl() Convert a 32-bit quantity from host byte order to network byte order.

htons() Convert 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() Provide control for descriptors.

listen() Listen for incoming connections on a specified socket.

ntohl() Convert a 32-bit quantity from network byte order to host byte order.

ntohs() Convert a 16-bit quantity from network byte order to host byte order.

recv()* Receive data from a connected socket.

recvfrom()* Receive data from either a connected or unconnected socket.

select()* Perform synchronous I/O multiplexing.

send()* Send data to a connected socket.

sendto()* Send data to either a connected or unconnected socket.

setsockopt() Store options associated with the specified socket descriptor.

shutdown() Shut down part of a full-duplex connection.

socket() Create an endpoint for communication and return a socket descriptor.

* The routine can block if acting on a blocking socket.


[Back: Socket Library Overview]
[Next: Blocking/Non blocking & Data Volatility]