Jump to content
Keesver

Passing data between sockets

Recommended Posts

I can remember seeing a method or class in Indy which allowed me to connect an incoming socket to an outgoing socket directly so that data flows from in to out. However I can't remember the name or file where I can find it. Any ideas?

Edited by Keesver

Share this post


Link to post

You are probably thinking of the TIdTCPStream class.  You can assign a target TIdTCPConnection to it, and then pass it to the IOHandler.ReadStream() method of a source TIdTCPConnection.  You can then tell ReadStream() to either read a specific number of bytes, or to read endlessly until the source socket disconnects.  Any bytes read in from the source will be written out to the target.

Edited by Remy Lebeau

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×