How to 'pipe' or 'chain' output of a server socket to the input of another server socket similar to sendfile?
In开发者_如何学运维 Linux, using sendfile you can directly transfer file out to a socket.
But let's say we have two server socket, we want to the output of the first one to go out to the second one.
How to do that? Instead of
data=sock1.read()
sock2.write(data)
I believe dup2 will work
精彩评论