Reading and Writing from same network stream

J

John

I have a Socket open to a target system. I get the network stream from the
open socket and then create a stream reader and stream writer on this
stream. The stream reader and writers are operating on different threads.

Does anyone know if it is possible to read and write to the same stream
using two different streaming object as mentioned here.

John
 
W

William Stacey [MVP]

I know you can read on one thread and write on another to same socket.
However, I don't think you can "reliabably" read and write in each thread to
same socket. You don't need to share the stream, create another writer
steam on the other thread to same socket for write only. Does that help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top