Waiting for (some) input available?
I have a socket stream and I'd like to use READ-SEQUENCE on it when there's some data available. However, I don't want to wait until there's necessarily a full sequence's worth of data available. I think I want something like this: - (setf socket (open-tcp-stream ... :read-timeout 0)) - (setf buffer (make-array 1024 :element-type '(unsigned-byte 8))) - (some-waiting-function socket) - (read-sequence buffer socket) The last step would immediately read some pending octets from the socket, if there were any. I don't think I want a read-timeout of nil on the stream, since that seems to wait until the buffer is completely full. What should I do in place of some-waiting-function? Or is there some other approach to read whatever's available on a socket, regardless of the amount of data it might be? Zach