Hello ,
I m writing a code realted to TCP/IP application. When the " client tries to connect to server and the server is not listening " condition, i m using recurcive function just to keep on trying till the server starts listening.
The problem is, the form or screen become dead. Even though I wrote the statement to disable some textbox and buttons before starting the above mentioned recursive function, disable action is not occuring.
private void btnActivate_Cli ck(object sender, EventArgs e)
{
//disable the textbox ,buttons etc...
StartConnecting ( );
}
private void StartConnecting ( )
{
try
{
_clientSocket.C onnect(ipEndPoi nt);
............
..............
..............
}
catch
{
StartConnecting ( );
}
}
what might be the problem.
should i use backgroundworke r of threadpool .
thanks in advance
I m writing a code realted to TCP/IP application. When the " client tries to connect to server and the server is not listening " condition, i m using recurcive function just to keep on trying till the server starts listening.
The problem is, the form or screen become dead. Even though I wrote the statement to disable some textbox and buttons before starting the above mentioned recursive function, disable action is not occuring.
private void btnActivate_Cli ck(object sender, EventArgs e)
{
//disable the textbox ,buttons etc...
StartConnecting ( );
}
private void StartConnecting ( )
{
try
{
_clientSocket.C onnect(ipEndPoi nt);
............
..............
..............
}
catch
{
StartConnecting ( );
}
}
what might be the problem.
should i use backgroundworke r of threadpool .
thanks in advance
Comment