On Sun, Nov 26, 2023 at 09:59:58PM +0100, Erik Grun wrote: > Hello, Guile-Devel, > > I just can't get the Network Socket Examples[1] to work. I am using Guile > 3.0.7. > > An obvious mistake seems to be, that the docs use different ports for client > (80) and server (2904), but even if I use the same port (2904), I only get > this error message: > > Backtrace: > In ice-9/boot-9.scm: > 1752:10 6 (with-exception-handler _ _ #:unwind? _ # _) > In unknown file: > 5 (apply-smob/0 #) > In ice-9/boot-9.scm: > 724:2 4 (call-with-prompt _ _ #) > In ice-9/eval.scm: > 619:8 3 (_ #(#(#))) > In ice-9/boot-9.scm: > 2835:4 2 (save-module-excursion _) > 4380:12 1 (_) > In /home/egnun/client.scm: > 7:14 0 (_) > > /home/egnun/client.scm:7:14: Unbound variable: read-line > > After some research I found out, that I need to include this line. > (use-modules (ice-9 rdelim)) Yes, I'd consider both of the above as downright doc bugs: the missing of (ice-9 rdelim) in the client code and letting the client aim at a different port the server is set up to listen to. As for the third... > When I do that, it seems to kinda work? > > Hello client > Backtrace: [...] > ERROR: In procedure %read-line: > In procedure fport_read: Connection was reset by peer ... it is working "as it is supposed to": the server closes the connection after sending the reply -- the client isn't set up to expect this and complains (note that it dutifully prints the server's answer "Hello client" before). So this one is confusing, but we'd need a bit more of discussion on how to "fix" it without complicating the examples too much. Ideas? Cheers -- t