Hi there,
I'm trying to use the ReadTimeout property to prevent a block when I call stream.read. I have my read running on a seperate thread, but I believe when it blocks, even if on another thread I cannot send on that same stream. Is that a correct assumption? When I try and set the ReadTimeout of the I get a NullReferenceException. Thissomewhat makes sense since my ReadTimeout property is a member of NetworkStream. NetworkStream requires an instance which takes a socket as a parameter upon class instantiation. This is where I am confused. I didn't think I'd need to use an independent socket when using getStream().
So in a nutshell what is happening is on the main thread I have a checkconnection timer that fires and send a ping to a remote device. When that remote device receives the ping, it sends back a response and the sender is then supposed to receive that response. The problem is that my receiver thread is blocking in the Read(param1, param2, param3) call which in turn prevents anymore pings being sent out. At that point I lose all comms.
Thanks,
Mike
Edit: And yes I am only setting ReadTimout after I call GetStream()