Hi, Kevin Ryde writes: > ludovic.courtes@laas.fr (Ludovic Courtès) writes: >> >> Right. That's an incompatible change if the _output_ is buffered. >> Input can be buffered, though, without this being visible by users. > > Alas, that too is in an incompatible change, because recv! ignores > buffering. Hmm, right. > Sounds good. Perhaps `setvbuf-input' and `setvbuf-output' for the two > directions. They could go in 1.8 too if you're careful with the > implementation. Below is a tentative patch (I chose more meaningful names since they don't relate to `setvbuf(3)'). The issue is that it duplicates fport buffering logic, but I couldn't think of a nice way to factorize this with, e.g., `scm_fport_buffer_add ()'. What do you think? Besides, how about applying the change I originally proposed to HEAD? That would require changing `recv!', `send', etc. so that they are somehow "buffering-aware". Ideally, it would be nice if they didn't break through the port abstraction as they currently do, but I don't know how that could be implemented (what should be the meaning of `MSG_DONTROUTE' on an input string buffer? ;-)). >> It >> does nothing for O_NONBLOCK streams and waits for events otherwise. >> Since, for blocking streams, `read ()' does not return until either EOF >> is reached or at least one octet was read, `fport_wait_for_input ()' >> seems redundant. > > Ahh, hang on, I wonder if it's a hack to do an "exit guile" while > blocked within a read(), thus allowing gc to run in other threads. Indeed, `scm_std_select ()' does a "leave guile". > If that's true then presumably the write side is afflicted too, as > well as various other potentially blocking operations like > read-string!/partial and gethost. Afflicted by what? Thanks, Ludovic.