Hi Peter,
Thank you so much for the help! I just tried it on a linux box and I can confirm you that is a windows specific behaviour :(
> I tested it out (via csi -s mini-tcp-server.scm) and it kept looping and
> when I connected with telnet it started printing "Hola" to my telnet
> client.
>
> Is that the correct behaviour?
Yes it is, the thing is that "Hola" was a test and should happens no matter what because is in a separate thread, but unfortunately the behaviour on Windows is that it gets stopped by the read-line function.
> Perhaps you're running it from the REPL? The standard input for csi is
> usually line-buffered, so it's the OS itself which might be blocking the
> process while reading from stdin for the next command to run. This can
> be worked around on UNIX by installing the parley egg. However, I don't
> know if this works on Windows, because of the above-mentioned FUBAR
> select() implementation.
I am not using the REPL because I noticed that it was blocking everything unless I did a thread-join, so I opted to compile and test all the time (like we do with our old friend C/C++ :)
> It shouldn't be, but our Windows implementation uses Winsock select(),
> which is really Microsoft's own "special" interpretation of POSIX select()> which doesn't work on anything except sockets. However, this *should*
> still work since you're only using tcp ports.
This makes a lot of sense, so I guess my only option is too debug the C++ side of the tcp implementation on Windows? Or do you know a workaround I could try for this?
Thanks again for everything, All your comments had been very helpful
Cheers,
Pedro