Hi
That means you are blocking the main thread.
Try this:
public bool startServer()
{
if (_serverThread != null)
{
return false;
}
Task taskA = Task.Factory.StartNew(() =>
{
Server _Server = null;
_Server = new Server();
_Server.callback += new EventHandler(server_callback);
});
return true;
}
The Task factory will guarantee to start a separate thread, and I am not sure whether do you need to check the "_serverThread" at all.
Regards
Jegan