Interestingly enough, your post got me thinking, and I added the bold code below.
while (bIncoming[0] != (byte)MessageWrapper.SOM)
{
// Loop Waiting for and Start Of Message Character
tryRead = 1;
read = connectionSocket.Receive(bIncoming, 0, tryRead, SocketFlags.None);
Byte[] b = new byte[1];
b[0] = 0x30;
connectionSocket.Send(b, 1, SocketFlags.None);
}
Now, I get an exception that the host has aborted the transaction on the second time through the loop! The first receive appears to be successful, the send is successful, then the subsequent receive fails. Any idea how to create/catch the exception without the need of a Send? The send will mess up the server when the server does decide to respond properly. Thanks for your help. James