11
1
Write the shortest program that answers "Hello, World" to a network connection.
Conditions:
- 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
Test:
prompt> telnet localhost 12345
Hello, World
prompt>
6
This is essentially a less interesting version of http://codegolf.stackexchange.com/questions/3988
– Peter Taylor – 2013-04-12T14:06:46.687Does it have to close the connection after the Hello World! Or can it just hang? – Magic Octopus Urn – 2017-01-19T17:32:01.060
@carusocomputing Second point. – Carcigenicate – 2017-01-19T19:41:01.330
I just think it's worth pointing out that this question was recently necro'd from 2013. That only means what it means, but I want to make sure people aren't missing this. – H Walters – 2017-01-29T04:56:39.613