Sockets System Functions
The system functions supported by the sockets APIs are:
- accept() (Wait for an incoming connection and tie that connection to the application) is used to wait for connection requests.
- accept_and_recv() (Wait for connection request and receive the first message that was sent.) is used to wait for an incoming connection request, receive the first message from the peer, and return the local and remote socket addresses associated with the connection.
- bind() (Set a local address for the socket) is used to associate a local address with a socket.
- close() (Close file descriptor) closes a descriptor, fildes.
- connect() (Bind a destination to a socket or set a connection) is used to establish a connection on a connection-oriented socket or establish the destination address on a connectionless socket.
- fcntl() (Perform file control command) performs various actions on open descriptors.
- fstat() (Get file information by descriptor) gets status information about the file specified by the open file descriptor file_descriptor and stores the information in the area of memory indicated by the buf argument.
- getdomainname() (Retrieve domain name for the system) is used to retrieve the name of the domain from the system.
- gethostid() (Retrieve host ID for the system) is used to retrieve a host ID's 32-bit IP address.
- gethostname() (Retrieve host name for the system) is used to retrieve the name of the host from the system.
- getpeername() (Retrieve destination address of a socket) is used to retrieve the destination address to which the socket is connected.
- getsockname() (Retrieve local address of a socket) is used to retrieve the local address associated with the socket.
- getsockopt() (Allow an application to request information about a socket (timeout, retransmission, buffer space)) is used to retrieve information about socket options.
- givedescriptor() (Pass the access rights to a descriptor) is used to pass a descriptor from one i5/OS job to another i5/OS job.
- if_freenameindex() (Free dynamic memory allocated by if_nameindex()) frees the dynamic memory that was allocated by if_nameindex().
- if_indextoname() (Map an Interface index to its corresponding name ) places the name of the interface with index ifindex into the buffer pointed at by ifname.
- if_nameindex() (Return all interface names and indexes) returns an array of if_nameindex structures, one structure per interface.
- if_nametoindex() (Map an Interface Name to its Corresponding Index s) returns the interface index corresponding to name ifname.
- ioctl() (Perform I/O control request) performs control functions (requests) on a file descriptor.
- listen() (Prepare a socket for incoming connections) is used to indicate a willingness to accept incoming connection requests. If a listen() is not done, incoming connections are silently discarded.
- poll() (Wait for Events on Multiple Descriptors) enables an application to wait for events on multiple descriptors.
- QsoCreateIOCompletionPort() (Create I/O Completion Port) is used to create a common wait point for a completed overlapped I/O operation.
- QsoDestroyIOCompletionPort() (Destroy I/O Completion Port) is used to destroy an I/O completion port.
- QsoPostIOCompletion() (Post I/O Completion Request) will post an Qso_OverlappedIO_t request on a specifed I/O completion port.
- QsoStartAccept() (Start Asynchronous Accept Operation) is used to wait asynchronously for connection requests.
- QsoStartRecv() (Start Asynchronous Receive Operation) is used to initiate a asynchronous receive operation.
- QsoStartSend() (Start Asynchronous Send Operation) is used to initiate a asynchronous send operation.
- QsoWaitForIOCompletion() (Wait for I/O Operation) is used to wait for a completed overlapped I/O operation.
- Rbind() (Establish remote bind) used to request that a SOCKS server allow an inbound connection request across a firewall.
- read() (Read from Descriptor) reads nbyte bytes of input into the memory area indicated by buf.
- readv() (Read from Descriptor Using Multiple Buffers) is used to receive data from a file or socket descriptor.
- recv() (Receive data using a socket descriptor) is used to receive data through a socket.
- recvfrom() (Receive data and remote address using a socket descriptor) is used to receive data through a connected or unconnected socket.
- recvmsg() (Receive data and remote address using a socket descriptor and multiple buffers (scatter read)) is used to receive data or descriptors or both through a connected or unconnected socket.
- rexec() (Issue a command on a remote host) is used to open a connection to a remote host and send a user ID, password, and command to the remote host.
- rexec_r() (Issue a command on a remote host) is used to open a connection to a remote host and send a user ID, password, and command to the remote host.
- rexec_r_ts64() (Issue a command on a remote host) is used to open a connection to a remote host and send a user ID, password, and command to the remote host.
- rexec_tx64() (Issue a command on a remote host) is used to open a connection to a remote host and send a user ID, password, and command to the remote host.
- select() (Allow a single process to wait for connections on multiple sockets) is used to enable an application to multiplex I/O.
- send() (Send data using a socket descriptor) is used to send data through a connected socket.
- send_file() (Send a file over a socket connection) is used to send the contents of an open file over an existing socket connection.
- send_file64() (Send a file over a socket connection) is used to send the contents of an open file over an existing socket connection.
- sendmsg() (Send data with a destination address using a socket descriptor and multiple buffers (gather write)) is used to send data or descriptors or both through a connected or unconnected socket.
- sendto() (Send data with a destination address using a socket descriptor) is used to send data through a connected or unconnected socket.
- setdomainname() (Set domain name for the system) is used to set the name of the domain.
- sethostid() (Set Host ID) is used to set a host ID.
- sethostname() (Set host name for the system) is used to set the name of the host for a system.
- setsockopt() (Allow an application to set characteristics of a socket (timeout, retransmission, buffer space)) is used to set socket options.
- shutdown() (End Receiving and/or Sending of Data on Socket) is used to disable reading, writing, or reading and writing on a socket.
- socket() (Create a socket) is used to create an end point for communications.
- socketpair() (Create a pair of sockets) is used to create a pair of unnamed, connected sockets in the AF_UNIX or AF_UNIX_CCSID address_family.
- takedescriptor() (Receive the access rights to a descriptor) is used to obtain a descriptor in one i5/OS job which was passed from another i5/OS job by a givedescriptor().
- write() (Write to Descriptor) writes nbyte bytes from buf to the file or socket associated with file_descriptor.
- writev() (Write to Descriptor Using Multiple Buffers) is used to write data to a file or socket descriptor.
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.