Talk:Echo server: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Ruby example: new section)
(→‎Ruby example: Acknowledge the fix)
Line 9: Line 9:


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)
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)
: It was fixed by [[User:Schultzi]]. Thanks! –[[User:Dkf|Donal Fellows]] 21:54, 6 December 2009 (UTC)

Revision as of 21:54, 6 December 2009

Similarities

For some reason, this task resembles half (only the server part) of another task, Distributed program; I believe that with few changes every server code given there could be "imported" here. Therefore basically this task seems an almost-duplicate. So it seems to me. --ShinTakezou 17:48, 13 May 2009 (UTC)

I think they are different -- this task emphasizes byte-stream network programming and multitasking, that task emphasizes high-level communication and message passing. I had planned to create a task something like this myself, and I also created Distributed Program. --Kevin Reid 19:14, 13 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. —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. –Donal Fellows 13:43, 1 December 2009 (UTC)

It was fixed by User:Schultzi. Thanks! –Donal Fellows 21:54, 6 December 2009 (UTC)