• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

network programming question

wildwolf

Golden Member
Hi.

I want to be able to have a perl script (but am willing to switch languages if it's easier) running and accepting connections from 2 different machines in my home, receive the input (ascii text) from one, and send it (still as ascii text) to the other.

The easiest way to explain it, is I almost want a proxy. In a proxy, a program accepts a connection (it is a server) with an address, it connects TO that address (connecting as a client), and returns what was returned to it to the original connection, right?

What I need is a server, that accepts a client's connection, receives its data. Accepts another connection from a different client, and sends client1 data to client2. Both connections need to remain...well connected, if possible.

I hope this is explained well enough. I am not looking for anybody to write this, I am just hoping somebody can point me into the right direction on how to accept two connections and keep them open...and pass data from one to the other (data will always only flow 1 way): client1 => client2.

I've looked at this for sometime now, and am baffled on how to accomplish this.

Thanks.
 
My first question would be, why the middle man? Is there a reason to not just have client1 talk directly to client2? Or is it just to act as a buffer since the times that client1 will be sending data and client2 wants to receive data will be out of sync?

Not sure how to program sockets in perl, but it's a fairly simple exercise in either C or Java. Plenty of sample code can be found in either language.
 
Back
Top