Talk:Echo server: Difference between revisions

Content added Content deleted
(→‎Ruby example: new section)
Line 5: Line 5:


I wrote this task to emphasize network server basics. It's meant to be something that someone wanting a simple net protocol implementation could take, adapt and use. I ''really'' hope that it's one that many languages can do a good implementation of. —[[User:Dkf|Dkf]] 20:11, 21 May 2009 (UTC)
I wrote this task to emphasize network server basics. It's meant to be something that someone wanting a simple net protocol implementation could take, adapt and use. I ''really'' hope that it's one that many languages can do a good implementation of. —[[User:Dkf|Dkf]] 20:11, 21 May 2009 (UTC)

== Ruby example ==

That Ruby example is wrong; the while loop accepts a new connection each time round and assumes that each time round the loop it will either close the new, connected socket or read a single line from it (and echo it) before dropping it unceremoniously without closing it. I find it hard to accept that this is correct! In particular, if you try to connect and send two lines of data to it, only the first one will be echoed. –[[User:Dkf|Donal Fellows]] 13:43, 1 December 2009 (UTC)