When I run the sample programs "crystal tcp_server.cr" and then "crystal tcp_client.cr" The server receives the first message from the client, but the client hangs when attempting to read the response from the server. I've modified the tcp_server.cr so that the programs operate as what I believe should be expected, however there probably is a better way to do it than I have as I've just begun learning Crystal and have only limited Ruby experience. Here is the modified file. I am using Crystal 0.22 with Ubuntu 16.04.2 LTS.
@wjmacfarland thanks for reporting, I fixed by using IO#puts so the newline character is added and the tcp_client will read until it when doing the IO#gets.
Shouldn't IO#read_line (i.e. IO#gets) return the message with the terminating newline character included?
@straight-shoota Nope, it was changed in 0.20.3, see #3704.
Oh, thanks! Seems like I missed that change...
Most helpful comment
@straight-shoota Nope, it was changed in
0.20.3, see #3704.