The sockets API consists of functions, structures, and defined macros. There are two categories of functions: system functions and network functions. The structures and defined macros are shipped as header files. See Sockets Programming for more information about sockets programming.
An important part of interprocess communications is to locate and construct network addresses. Many of the socket network APIs are inherently not threadsafe. Threadsafe APIs have been added to mirror the function provided by the non-threadsafe APIs. All threadsafe APIs follow the UNIX convention of appending R to the API name denoting threadsafe.
The following table lists system functions supported
by the sockets API.
| Operation | Description |
|---|---|
| accept() | Wait for an incoming connection and tie that connection to the application. |
| accept_and_recv() | Wait for connection request and receive the first message that was sent. |
| bind() | Set a local address for the socket. |
| close() | End a socket connection. |
| connect() | Bind a destination to a socket or set a connection. |
| fcntl() | Change descriptor attributes. |
| fstat() | Retrieve status information about a descriptor. |
| getdomainname() | Retrieve domain name for the system. |
| gethostid() | Retrieve hostid for the system. |
| gethostname() | Retrieve host name for the system. |
| getpeername() | Retrieve destination address of a socket. |
| getsockname() | Retrieve local address of a socket. |
| getsockopt() | Allow an application to request information about a socket (timeout, retransmission, buffer space). |
| givedescriptor() | Pass the access rights to a descriptor. |
| ioctl() | Change descriptor attributes. |
| listen() | Prepare a socket for incoming connections. |
| Rbind() | Establish remote bind. |
| read() | Read data using a descriptor. |
| readv() | Read data using a descriptor and multiple buffers (scatter read). |
| recv() | Receive data using a socket descriptor. |
| recvfrom() | Receive data and remote address using a socket descriptor. |
| recvmsg() | Receive data and remote address using a socket descriptor and multiple buffers (scatter read). |
| snadbg | Debugging IP over SNA. |
| select() | Allow a single process to wait for connections on multiple sockets. |
| send() | Send data using a socket descriptor. |
| send_file() | Send a file over a socket connection. |
| send_file64() | Send a file over a socket connection. |
| sendmsg() | Send data with a destination address using a socket descriptor and multiple buffers (gather write). |
| sendto() | Send data with a destination address using a socket descriptor. |
| setdomainname() | Set domain name for the system. |
| sethostid() | Set hostid for the system. |
| sethostname() | Set host name for the system. |
| setsockopt() | Allow an application to set characteristics of a socket (timeout, retransmission, buffer space). |
| shutdown() | Disable receive, or send, or receive/send operations on a socket. |
| socket() | Create a socket |
| socketpair() | Create a pair of sockets. |
| takedescriptor() | Receive the access rights to a descriptor. |
| write() | Write data using a descriptor. |
| writev() | Write data using a descriptor and multiple buffers (gather write). |
Note: These functions use header (include) files from the library QSYSINC, which is optionally installable. Make sure QSYSINC is installed on your system before using any of the functions.
|
Top
| Sockets Network Functions (Routines) UNIX-Type APIs | APIs by category |
| [Information Center Home Page | Feedback ] | [Legal | AS/400 Glossary] |