Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple streams

Status
Not open for further replies.

cgillin

Programmer
Joined
Mar 20, 2003
Messages
58
Location
US
I have to create a file transfer program. What I have right now is a server and client that can transfer text files by reading one line of text at a time and sending it over the socket. What I want to do is keep the text stream so that I can communicate what files are available on the server end and let the client type back what they would like. Is it possible to create a second stream, a byte stream, on the same socket to transfer files?

Thanks for the help
Chris
 
No I don't think so, I believe there is only one Input and one Output stream per socket. What you could do is open a connection on a new socket that's handled by a seperate thread to transfer files. Use the address from the first socket and find an agreeable port # to do this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top