private void listenForClients()
{
try
{
this.tcpListener.Start();
}
catch (SocketException)
{
Log.Error("World.Listener", "Failed to bind to the address " + IP + ":" + Port + "! Retry in 5 seconds.");
Thread.Sleep(5 * 1000);
listenForClients();
}
Log.Succes("World.Listener", "Expecting worlds to connect at " + IP + ":" + Port);
while (true)
{
TcpClient client = this.tcpListener.AcceptTcpClient();
Thread clientThread = new Thread(new ParameterizedThreadStart(handleWorld));
clientThread.Start(client);
}
}