Transferring data between sockets

This topic contains information about transferring data between sockets. All examples are shown using an address family of AF_INET (IPv4). All concepts also can be applied to an address family of AF_INET6 (IPv6). The following topics are included:

Transferring data over a datagram socket is similar to working with MVS™ records. You send and receive data records. One send() call results in exactly one recv() call.

If your sending program sends a datagram of 8192 bytes, and your receiving program issues a recv() call in which it specifies a buffer size of, for example, 4096 bytes, it will receive the 4096 bytes it requested. The remaining 4096 bytes in the datagram are discarded by the UDP protocol layer without further notification to either sender or receiver.

z/OS® Communications Server includes a performance enhancement that when both the source and destination of a packet are known to and managed by a single TCP/IP stack, the IP layer can be bypassed. This provides an overall pathlength savings when processing such packets, and the decrease in pathlength through the stack results in an overall throughput improvement for applications that reside on the same MVS systems and communicate with each other through the same TCP/IP stack. Socket application programmers can take advantage of this performance enhancement by using a non-loopback home address when sending data between applications that reside on the same MVS system and communicate with each other through the same TCP/IP stack. See z/OS Communications Server: New Function Summary for additional information.