Skip to content

Commit 94e4fb1

Browse files
committed
Extra check fix!
1 parent 9f5def0 commit 94e4fb1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Program.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,7 @@ public static int Main(string[] args)
6666
monitor.Start();
6767
}
6868

69-
try
70-
{
71-
server = new WatsonTcpServer(config.Hostname, config.Port);
72-
} catch (System.Net.Sockets.SocketException)
73-
{
74-
Console.WriteLine("A server is already running, please quit it and try again. If PPG is open, please close it.");
75-
return 255;
76-
}
69+
server = new WatsonTcpServer(config.Hostname, config.Port);
7770

7871
WatsonTcpServerSettings settings = server.Settings;
7972
settings.Logger = (Action<Severity, string>)Delegate.Combine(settings.Logger, new Action<Severity, string>(delegate (Severity s, string m)
@@ -100,7 +93,16 @@ public static int Main(string[] args)
10093
};
10194

10295
server.Callbacks.SyncRequestReceived = (SyncRequest e) => new SyncResponse(e, "deze snap ik niet ouwe");
103-
server.Start();
96+
97+
try
98+
{
99+
server.Start();
100+
}
101+
catch (System.Net.Sockets.SocketException)
102+
{
103+
Console.WriteLine("A server is already running, please quit it and try again. If PPG is open, please close it.");
104+
return 255;
105+
}
104106

105107
Console.WriteLine(string.Format("Started listening on {0}:{1}", config.Hostname, config.Port));
106108
while (!server.IsListening)

0 commit comments

Comments
 (0)