Part 1 of Assignment 2 - Starting and Closing the Client
ClientFrame
When you are finished with the assignment your Client Frame should be a version of:
- When ClientFrame starts, as part of the startup, after the Frame is built, a Magic String should automatically be sent to ChatThread.
I use "start_up123" as the string. The ChatThread returns "Connected". This handshake triggers
accept().
- When the Close Window button or top right "X" is clicked the present WindowClosing should run
but first a Magic String should be sent to ChatThread. I use "shut_down123" as the string. This string alerts the
ChatThread to close the current socket connection and return to accept() state.
ChatThread
- accept() should be in a while(true) outer loop.
- When ChatThread sees the close Magic String is should close() the Socket, Scanner, and
PrintWriter and loop back to the outer loop accept().