The system functions supported by the sockets APIs are:
accept() (Wait for Connection Request and Make Connection) 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 Local Address for Socket) is used to associate a local address with a socket.
bind2addrsel() (Set Local Address for Socket with Address Selection Preferences) associates a local address with a connection oriented socket based on the address selection preferences and destination address.
close() (Close File or Socket Descriptor) closes a descriptor, fildes.
connect() (Establish Connection or Destination Address) 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) is used to retrieve the name of the domain from the system.
gethostid() (Retrieve Host ID) is used to retrieve a host ID's 32-bit IP address.
gethostname() (Retrieve Host Name) is used to retrieve the name of the host from the system.
getpeername() (Retrieve Destination Address of Socket) is used to retrieve the destination address to which the socket is connected.
getsockname() (Retrieve Local Address of Socket) is used to retrieve the local address associated with the socket.
getsockopt() (Retrieve Information about Socket Options) is used to retrieve information about socket options.
getsourcefilter() (Retrieve a Socket's Multicast Filter) is used to retrieve the multicast filtering state for a tuple that consists of a socket, an interface, and a multicast group.
givedescriptor() (Pass Descriptor Access to Another Job) is used to pass a descriptor from one IBM i job to another IBM i 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) returns the interface index corresponding to name ifname.
inet6_is_srcaddr() (Validate the Given Address Based on Address Selection Preferences) determines if the specified address satisfies the address selection preference flags.
inet6_opt_append() (Append New Option to IPv6 Extension Header) returns the updated total length of the extension header after adding the new option and alignment.
inet6_opt_append_ts64() (Append New Option to IPv6 Extension Header) returns the updated total length of the extension header after adding the new option of length, option_length, and alignment, alignment.
inet6_opt_find() (Extract Option of Specified Type from IPv6 Extension Header) parses a received option extension header and returns the next option of a specified type.
inet6_opt_find_ts64() (Extract Option of Specified Type from IPv6 Extension Header) parses a received option extension header and returns the next option of a specified type.
inet6_opt_finish() (Finish Adding Options to IPv6 Extension Header) returns the length of the IPv6 extension header, including padding, to make the extension header 8-byte aligned.
inet6_opt_get_val() (Retrieve Data Item from an IPv6 Option) is used to extract data items of various sizes from the data portion of the IPv6 option.
inet6_opt_init() (Initialize Buffer Data for IPv6 Extension Header) returns the number of bytes needed for an extension header without any options.
inet6_opt_next() (Extract the Next Option from the IPv6 Extension Header) parses a received option extension header and returns the next option.
inet6_opt_next_ts64() (Extract the Next Option from the IPv6 Extension Header) parses a received option extension header and returns the next option.
inet6_opt_set_val() (Insert Data Items into IPv6 Option) is used to insert data items of various sizes into the data portion of the IPv6 option.
inet6_rth_add() (Add an IPv6 Address to the IPv6 Routing Header) adds the IPv6 address that is pointed to by the routing_address parameter to the end of the routing extension header that is being constructed.
inet6_rth_getaddr() (Retrieve an Address from the IPv6 Routing Header) returns a pointer to the IPv6 address at the specified index in the routing header.
inet6_rth_init() (Initialize Buffer Data for the IPv6 Routing Header) is used to initialize the buffer to contain a routing extension header.
inet6_rth_reverse() (Reverse the Order of Addresses in the IPv6 Routing Header) reads a routing extension header and writes a new routing extension header with the addresses in reverse order.
inet6_rth_segments() (Return the Number of Segments in the IPv6 Routing Header) returns the number of segments (addresses) in the routing extension header.
inet6_rth_space() (Return the Number of Bytes Required for the IPv6 Routing Header) returns the number of bytes required to hold a routing extension header.
ioctl() (Perform I/O Control Request) performs control functions (requests) on a file descriptor.
listen() (Invite Incoming Connections Requests) 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) is used to enable an application to multiplex I/O over a set of descriptors.
QsoCancelOperation() (Cancel an I/O Operation) is used to cancel one or more asynchronous I/O operations that are pending on the socket.
QsoCreateIOCompletionPort() (Create I/O Completion Port) is used to create a common wait point for a completed overlapped I/O operation.
QsoGenerateOperationId() (Get an I/O Operation ID) is used to get an operation identifier that is unique for this socket.
QsoIsOperationPending() (Check if an I/O Operation is Pending) is used to check if one or more asynchronous I/O operations is pending on the socket.
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() (Set Remote Address for Socket) 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) is used to receive data through a socket.
recvfrom() (Receive Data) is used to receive data through a connected or unconnected socket.
recvmsg() (Receive a Message Over a Socket) 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_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.
select() (Wait for Events on Multiple Sockets) is used to enable an application to multiplex I/O.
send() (Send Data) is used to send data through a connected socket.
sendmsg() (Send a Message Over a Socket) is used to send data or descriptors or both through a connected or unconnected socket.
sendto() (Send Data) is used to send data through a connected or unconnected 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.
setdomainname() (Set Domain Name) is used to set the name of the domain.
sethostid() (Set Host ID) is used to set a host ID.
sethostname() (Set Host Name) is used to set the name of the host for a system.
setsockopt() (Set Socket Options) is used to set socket options.
setsourcefilter() (Set a Socket's Multicast Filter) is used to set the multicast filtering state for a tuple that consists of a socket, an interface, and a multicast group.
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 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 Socket Access from Another Job) is used to obtain a descriptor in one IBM i job which was passed from another IBM i 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.