T
Tom Rahav
Hello All,
I developed a client-server file transfer application using C# for my
studies.
Everything works fine, but I use the follwing code (which I've found
somewhere over the net) and I'm wondering why does this code contain the
Sleep method. I know what this method does, but don't find the reason why to
use it here (althoght it works
Just to make it clearer, the server is waiting for client request, accept it
and handle the file transfer over new thread.
while(ClientForm.booServerActive)
{
if(oServerListener.Pending())
{
oTcpServer = oServerListener.AcceptTcpClient();
Thread oSendingThread = new Thread(new ThreadStart(SendingHandler));
oSendingThread.Start();
}
Thread.Sleep(60);
}
Thanks!
Tom.
I developed a client-server file transfer application using C# for my
studies.
Everything works fine, but I use the follwing code (which I've found
somewhere over the net) and I'm wondering why does this code contain the
Sleep method. I know what this method does, but don't find the reason why to
use it here (althoght it works
Just to make it clearer, the server is waiting for client request, accept it
and handle the file transfer over new thread.
while(ClientForm.booServerActive)
{
if(oServerListener.Pending())
{
oTcpServer = oServerListener.AcceptTcpClient();
Thread oSendingThread = new Thread(new ThreadStart(SendingHandler));
oSendingThread.Start();
}
Thread.Sleep(60);
}
Thanks!
Tom.