private void StartInternal logger Info Starting media server on port p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
private void StartInternal()
{
logger.Info("Starting media server on port {0}", port);
try
{
listener = new TcpListener(IPAddress.Parse(ip), port);
listener.Start();
new Thread(WaitForConnections)
{
IsBackground = true
}.Start();
logger.Info("Media server started");
}
catch (Exception e)
{
logger.Error("Failed to start media server. {0}. Retrying...", e.Message);
Thread.Sleep(5000);
StartInternal();
}
}