Thread (8 messages) flat view 8 messages, 3 authors, 2011-03-29

zero copy for relay server

From: Viral Mehta <hidden>
Date: 2011-03-28 16:27:17

Hi,
I am implementing a particular application where
my application acts nothing but like Relay Server.

Relay server accepts connection from machine A.
It also accepts connection from Machine B.

Machine A and B are on different LAN/subnnets.
Now, there are two connections.
What server is supposed to do is RECV packets from machine A and SEND same
to machine B.

Pseudo Code is something like,
while(1)
{
recvagain:
   n =3D recv(incoming_fd, &buf, 8192, ...)
   if(n < 0)
        goto recvagain;
   send(outgoing_fd, &buf, n, ...);
}

Now the question is,
I want to avoid kernel-user copy for such application.
I found that a syscall like "sendfile"; I wanted to know if there is any
similar thing exists in-kernel which can take 2 socket descriptors....

If not, is it possible ? I would like to implement the same if someone
can suggest some pointers.

Thanks,
Viral

The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and  using or disseminating the information,  and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"

______________________________________________________________________
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help