views:

85

answers:

2

I wrote a c# app that listens to port 8000 and 8001.

There are two different applications that connects to 8000 and 8001. I have used socket arrays so that any number of connections are accepted.

Will I be able to some how attach one 8000 connection and 8001 connection in such a way that what ever data send by the application connected at 8000 will be received by the app at 8001 and vise versa. What is this concept known as ? sorry if this is a very basic question.

+1  A: 

That sounds quite a bit like a proxy or a tunneler.

http://en.wikipedia.org/wiki/Proxy_server

In which case, yes this is entirely possible.

Though, if you're allowing multiple connections on both ports how will you know which connection goes with which? Say there are connections A, B and C on 8000 and X, Y and Z on 8001. Does the data from A go to Y and visa versa or does the data from B go to Y and visa versa?

Spencer Ruport
A or B or C connects to any one of X or Y or Z depending on a predefined table of IP addresses... So.. Can I get a suggestion of such a simple port proxy free software ?
A: 

In Java there are PipedInputStream and PipedOutputStream. Maybe the C# library offers something similar?

Bombe