Skip to content

concurrent connections

Latest

Choose a tag to compare

@rashmitpankhania rashmitpankhania released this 16 Nov 10:54
· 6 commits to main since this release

Server (com.rashmit.johncrickett.EchoServer): listens on a port, accepts one client, echoes each received line.
Client (com.rashmit.johncrickett.EchoClient): connects to host:port, sends stdin lines, prints echoed replies.
Run:

Compile: mvn -DskipTests compile
Server: java -cp target/classes com.rashmit.johncrickett.EchoServer 12345
Client: java -cp target/classes com.rashmit.johncrickett.EchoClient localhost 12345
Note: pass an explicit port when starting the server (it currently reads args[0] without checking length).