tag:blogger.com,1999:blog-8743735145097954046.post8244689523275456526..comments2024-03-04T12:31:46.014-05:00Comments on One Sad Jam: BeginRead WeirdnessAdam Joneshttp://www.blogger.com/profile/03047845969000890121noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8743735145097954046.post-57780417994950371842008-11-21T16:54:00.000-05:002008-11-21T16:54:00.000-05:00Here's a general response from someone who doe...Here's a general response from someone who doesn't speak .net.<br><br>Is it possible to have your reads always place the response they receive in some sort of labeled data structure container?<br><br>Whenever a read completes, the reader could spawn a process to that searches the container for the correctly labeled piece of data. That way you would always pair your requests up with the expected responses, even if you somehow switch to a non-blocking approach.Alcuinhttp://www.blogger.com/profile/16927282324472720929noreply@blogger.comtag:blogger.com,1999:blog-8743735145097954046.post-21946607587873728002008-11-22T20:41:00.000-05:002008-11-22T20:41:00.000-05:00That's a good idea. The tricky part will be k...That's a good idea. The tricky part will be keeping the stream used for reading responses in sync with the stream used for writing commands. Let's say I don't get a response, and it is due to the TCP connection to this device being dropped. I now need to create a new TcpClient connection and replace the stream used both in the global reader and in the writer.Adamhttp://www.blogger.com/profile/03047845969000890121noreply@blogger.com