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

Method run

src/Graphwar/GlobalClient.java:604–644  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

602 }
603
604 public void run()
605 {
606 while(running)
607 {
608 try
609 {
610 String message = connection.readMessage();
611
612 if(message == null)
613 {
614 disconnect(true);
615 }
616 else
617 {
618 handleMessage(message);
619
620 if(checkStayAliveTime())
621 {
622 sendKeepAlive();
623 }
624 }
625 }
626 catch (SocketTimeoutException e)
627 {
628 if(checkTimeout())
629 {
630 disconnect(true);
631 }
632 else
633 {
634 sendKeepAlive();
635 }
636 }
637 catch (IOException e)
638 {
639 e.printStackTrace();
640
641 disconnect(true);
642 }
643 }
644 }
645}

Callers

nothing calls this directly

Calls 6

disconnectMethod · 0.95
handleMessageMethod · 0.95
checkStayAliveTimeMethod · 0.95
sendKeepAliveMethod · 0.95
checkTimeoutMethod · 0.95
readMessageMethod · 0.80

Tested by

no test coverage detected