We already said that the basic function for creating sockets and working with them are identical for all supported address families. In a C program, an IPv6/TCP socket can be created in the usual way:

To make the long story short, all basic socket functions remain unchanged. Here is an alphabetical list with short descriptions (see the on-line manual pages for details):
bind()
Bind the socket to a local address.
close()
Close the socket.
connect()
Connect to a remote host.
getpeername()
Obtain the address of the remote end.
getsockopt()
Get the socket options.
listen()
Listen on the socket (wait for a connection request).
recv()
Read data from the connected socket. address.
recvfrom()
Read data from a specified source (mainly used with UDP sockets).
send()
Send data to a connected socket.
sendto()
Send data to a specified destination (mainly used with UDP sockets).
setsockopt()
Set socket options.
shutdown()
Terminate the communication in one or both directions.
