A.8 Summary of Socket Routines

This section groups and briefly describes the socket routines. For complete descriptions, see the routine reference section that follows in this appendix.

A.8.1 Basic Communication Routines

Table A-4 lists the basic communication routines that make up the building blocks of Internet programs.

Table A-4 Basic Communication Routines

Routine  Description 
accept  Accepts a connection on a socket. 
bind  Binds a name to a socket. 
close  Closes a connection and deletes a socket descriptor. 
connect  Initiates a connection on a socket. 
ioctl  Controls socket operations only. 
listen  Sets the maximum limit of outstanding connection requests for a socket. 
read  Reads bytes from a file or socket and places them into a buffer. 
readv  Not implemented. 
recv  Receives bytes from a socket and places them into a buffer. 
recvfrom  Receives bytes for a socket from any source. 
recvmsg  Receives bytes from a socket and places them into scattered buffers. 
select  Allows the polling or checking of a group of sockets. 
send  Sends bytes through a socket to a connected peer. 
sendmsg  Sends gathered bytes through a socket to any other socket. 
sendto  Sends bytes through a socket to any other socket. 
shutdown  Shuts down all or part of a bidirectional socket. 
socket  Creates an endpoint for communication by returning a socket descriptor. 
write  Writes bytes from a buffer to a file or socket. 
writev  Not implemented. 

A.8.2 Auxiliary Communication Routines

Table A-5 lists the auxiliary communication routines. These routines are used to provide information about a socket and to set the options on a socket.

Table A-5 Auxiliary Communication Routines

Routine  Description 
getpeername  Returns the name of the connected peer. 
getsockname  Returns the name associated with a socket. 
getsockopt  Returns the options set on a socket. 
setsockopt  Sets options on a socket. 

A.8.3 h_errno Support Routines

Table A-6 lists the h_errno support routines. These routines map and write error-message strings generated by the external integer h_errno.

Table A-6 Supported h_errno Routines

Routine  Description 
herror  Writes a message explaining a routine error. 
hstrerror  Accesses message explaining routine errors. 

A.8.4 Communication Support Routines

Table A-7 lists the communication support routines. These routines perform operations such as searching databases, converting byte order of network and host addresses, reading records, and returning Internet addresses.

Table A-7 Supported Communication Routines

Routine  Description 
decc$get_sdc  Returns the socket device's OpenVMS I/O channel associated with a socket descriptor. vaxc$get_sdc and decc$get_sdc are synonyms for the same routine. 
endhostent  Closes retrieval of network host entries and closes the network host file. 
endnetent  Closes the networks database file. 
endprotoent  Closes the protocols database file. 
endservent  Closes the network services database file. 
gethostaddr  Returns the standard host address for the processor. 
gethostbyaddr  Searches the host database for a host record with a given address. 
gethostbyname  Searches the host database for a host record with a given name or alias. 
gethostname  Returns the name of the current host. 
gethostent  Opens the network host entry by name from the network host database file. 
getnetbyaddr  Searches the network database for a network record with a given address. 
getnetbyname  Searches the network database for a network record with a given name or alias. 
getnetent  Gets a network file entry from the networks database file. 
getprotobyname  Searches the protocols database until a matching protocol name is found or until EOF is encountered. 
getprotobynumber  Searches the protocols database until a matching protocol number is found or until EOF is encountered. 
getprotoent  Gets a protocol database entry from the protocols database file. 
getservbyname  Gets information on the named service from the network services database. 
getservbyport  Gets information on the named port from the network services database. 
getservent  Gets a services file entry from the network services database file. 
hostalias  Searches for host aliases associated with a name. 
htonl  Converts longwords from network to host byte order. 
htons  Converts short integers from network to host byte order. 
inet_addr  Converts Internet addresses in text form into numeric Internet addresses. 
inet_lnaof  Returns the local network address portion of an Internet address. 
inet_ makeaddr  Returns an Internet address given a network address and a local address on that network. 
inet_netof  Returns the Internet network address portion of an Internet address. 
inet_ network  Converts a null-terminated text string representing an Internet network address into a network address in network byte order. 
inet_ntoa  Converts an Internet address into an ASCIZ (null-terminated) string. 
ntohl  Converts longwords from host to network byte order. 
ntohs  Converts short integers from host to network byte order. 
sethostent  Opens, rewinds, and closes the network host database file. 
setnetent  Opens, rewinds, and closes the networks database file. 
setprotoent  Opens, rewinds, and closes the protocols database file. 
setservent  Opens, rewinds, and closes the network services database file. 
socket_ fd  Returns the socket descriptor associated with a Socket Device Channel for direct use with the DEC C RTL. 
vaxc$get_sdc  Returns the socket device's OpenVMS I/O channel associated with a socket descriptor. vaxc$get_sdc and decc$get_sdc are synonyms for the same routine. 


Previous Page | Next Page | Table of Contents | Index