Could not receive Meesages from Socket
Windows Forms
1
Posts
1
Posters
0
Views
1
Watching
-
My Problem is when I debug my application I am getting broadcast messages from sever but not getting these broadcast when not in debugging mode. portion of the code iss do { byte[] myReadBuffer = new byte[tcpClient.ReceiveBufferSize]; int numberOfBytesRead = 0; try { if ( networkStream.CanRead) numberOfBytesRead = networkStream.Read(myReadBuffer, 0, myReadBuffer.Length); } catch (IOException) { networkStream = tcpClient.GetStream(); } if (numberOfBytesRead!=0) myCompleteMessage += System.Text.Encoding.ASCII.GetString(myReadBuffer,0,numberOfBytesRead); } while(networkStream.DataAvailable); if (myCompleteMessage.Length!=0) { DeliverMessage(myCompleteMessage,"","","",""); RegisterCompletion(); myCompleteMessage=""; } Close(); return true;