public void Shutdown()
{
lock (sync_)
{
if (State.RUNNING == state_)
{
try
{
state_ = State.SHUTDOWN_REQUESTED;
tcpListener_.Server.Close();
tcpListener_.Stop();
}
catch (System.Exception e)
{
this.Log("Error while closing server socket: " + e.Message);
}
}
}
}