Lets the protocol stack manage two sockets that use TCP.
#include <sys/types.h>
#include <sys/socket.h>
int splice(socket1, socket2, flags)
int socket1, socket2;
int flags;
The splice subroutine will let TCP manage two sockets that are in connected state thus relieving the caller from moving data from one socket to another. After the splice subroutine returns successfully, the caller needs to close the two sockets.
The two sockets should be of type SOCK_STREAM and protocol IPPROTO_TCP. Specifying a protocol of zero will also work.
socket1, socket2 | Specifies a socket that had gone through a successful connect() or accept(). |
flags | Set to zero. Currently ignored. |
0 | Indicates a successful completion. |
-1 | Indicates an error. The specific error is indicated by errno. |