Author: vinothkhannas | Posted on: 10/22/2010 12:05:59 PM | Views : 212

Hi All,
Am using socket connection to send and receive values. The following code is used to receive response.
while ((sizeReceived = skt.Receive(bytesReceived, bytesReceived.Length, SocketFlags.None)) > 0) { nTotalBytes += sizeReceived; sCleanresponse += Encoding.ASCII.GetString(bytesReceived, 0, sizeReceived); //Giving time to read the remaining amount System.Threading.Thread.Sleep(100); if (skt.Available > 0) continue; else break; }
In the above code, am facing a prob in skt.Available. If i dont give the thread.sleep, it is not repeating the while loop and it exits after onetime. And if i dont give skt.Available line, sometimes it throws socket Exception. I do no ...

Go to the complete details ...