MCPcopy Create free account
hub / github.com/catabriga/graphwar / waitConnection

Method waitConnection

src/GlobalServer/GlobalServer.java:328–359  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326 }
327
328 private void waitConnection() throws IOException
329 {
330
331 Socket tempSocket = null;
332 boolean connected = false;
333
334 try
335 {
336 tempSocket = serverSocket.accept();
337 connected = true;
338 System.out.println("Connection accepted!");
339 }
340 catch(Exception e)
341 {
342 connected = false;
343
344 e.printStackTrace();
345 }
346
347 if(connected)
348 {
349 Connection connection = new Connection(tempSocket);
350
351 LobbyPlayer player = new LobbyPlayer(connection, this);
352 new Thread(player).start();
353
354 synchronized(players)
355 {
356 this.players.add(player);
357 }
358 }
359 }
360
361 public void restartServer()
362 {

Callers 1

runMethod · 0.95

Calls 1

startMethod · 0.80

Tested by

no test coverage detected