Inducing wait interval.

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

Hi,

I am using sockets in my program. Somehow things work perfect while debugging
but fail when run without glitches.
How can I induce sleep periods in my code. I tried Thread.Sleep(20) but doesn't
seem to work.

Thank you.
 
Newbie said:
Hi,

I am using sockets in my program. Somehow things work perfect while debugging
but fail when run without glitches.
How can I induce sleep periods in my code. I tried Thread.Sleep(20) but doesn't
seem to work.

Thank you.

Silly me. Thread.Sleep is working :-)
Does anyone know how a socket send is made ina blocking manner.
Is it like -
m_socClient.Send (request, 0, request.Length, SocketFlags.None);

Thanks again.
 
Hi Newbie,

I would suggest that you recheck your protocol, I friend of mine had this
problem a time ago and it was a combination of using more than one stream
accesing the networkstream and a bad designed protocol.

You may have solved this using a Thread.Sleep() but what if your program is
run on a faster computer with a faster network? this could potentially
eliminate the sleep efect you are seeing now.

Cheers,
 
Back
Top