PDA

View Full Version : Dual TCP/IP Client/Server



jimroos
29th June 2007, 22:05
I'm writing a new application that is going to accept read data from one TCP/IP socket and reflect it to a second TCP/IP connection. My problem is that the application on the receive side needs to act as both a client (request connection) and server (listen for connection requests). The same will be true on the send side of my application. I have no idea if the distant applications are going to be TCP/IP clients or servers so I need to be able to support both on my end.

Does anybody have ideas or code examples on how I can address this problem?

Thanks

Jim.

jacek
29th June 2007, 22:58
Does anybody have ideas or code examples on how I can address this problem?
What problem? You simply want to develop some kind of a proxy or a broker and there is no problem in doing this. You'll need QTcpServer and QTcpSocket.