Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. // ***** Added for E49A - JD:
  2. // Hooking into the connectionClosed method from AbstractClient. Here if the connection is closed by
  3. // the server a message is printed indicating so, and then the client is terminated.
  4. @Override
  5. protected void connectionClosed() {
  6. System.out.print("Server has terminated. Connection has been closed.");
  7. System.exit(0);
  8. }
  9.  
  10. // ***** Added for E49A - JD:
  11. // Hooking into the connectingException method from AbstractClient. Here if an exception is thrown
  12. // by the client while waiting for messages, a message is printed and the client is terminated.
  13. @Override
  14. protected void connectionException(Exception exception) {
  15. System.out.print("Server has thrown exception. Connection has been closed.");
  16. System.exit(0);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement