Skip to content

Instantly share code, notes, and snippets.

@agiertli
Created April 10, 2016 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agiertli/968cb803736b48c0ada59d17f6011e35 to your computer and use it in GitHub Desktop.
Save agiertli/968cb803736b48c0ada59d17f6011e35 to your computer and use it in GitHub Desktop.
Do metody processInput som pridal:
System.out.println("Process input state:"+state);
Do metody Server.start som pridal:
System.out.println("Before client connection accepted");
clientSocket = serverSocket.accept();
new ClientHandler(clientSocket).start();
System.out.println("After thread started");
CLIENT vystup:
➜ ~ telnet localhost 3000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
200 LOGIN
Robot
201 PASSWORD
test
500 LOGIN FAILED
Connection closed by foreign host.
➜ ~ telnet localhost 3000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
SERVER vystup:
➜ Downloads java robot.Robot 3000
Starting server...
Before client connection accepted
After thread started
Before client connection accepted
Process input state:0
Process input state:1
Password: 518
Process input state:2
Invalid password
Invalid password. Disconnecting.
Disconnected.
After thread started
Before client connection accepted
Process input state:3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment