This question already has an answer here:
- A simple TCP server 39 answers
Write the shortest program that answers "Hello, World" to a network connection.
- Program shall listen on port 12345
- When a client connects, program shall write "Hello, World" to the newly opened socket connection and then close the connection
- Program shall accept connections in a loop, i.e. handle any number of connects
- Program does not need to handle parallel connections
prompt> telnet localhost 12345 Hello, World prompt>