On Mar 4, 12:39*am, steph <stepha...@yahoo.de> wrote:
> Hello,
> Maybe this is a bit of a dummy question ...
> What's the easiest way in linux to set up reading at one port and
> making the data available at another port. Sort of reading data from
> port x and writing them to port y.
> Thanks,
> Stephan
TCP on both sides? Is this unidirectional or bidirectional? The
simplest way would be to write a program that listens on whatever port
the connection originates on and then copies the data between the two
ports. If the connection must be bidirectional, you can 'fork' and use
one process to copy in each direction. If you need to handle more than
one connection at a time or performance is critical, it's probably
worth the effort to use splice(2) or epoll(4).
DS
|