From: Lorenz M. <moe...@in...> - 2010-03-21 01:59:23
|
Hi, SB-BSD-SOCKETS seems to have a bug when a socket is closed by the client and the server still wants to write. Then it is not possible anymore to close the stream and the file descriptor dangles around. Consider the following case: SBCL creates a socket, binds an address and calls accept. Any client (e.g. telnet) connects to it, but closes down the connection immediately. When the server tries to transmit data, a 'broken-pipe' condition will be raised. It is not possible anymore to close the stream because every close tries to flush the buffer, which again results in the broken pipe error. The only possibility to close down the stream is to clear the output buffer, but CLEAR-OUTPUT is not implemented for FB-STREAMs. This behavior is independent of the stream buffering, i.e. setting buffering to :none does not help. What would be an appropriate fix? Maybe handling the 'broken-pipe' error in fb-stream.lisp's FD-STREAM-MISC-ROUTINE function and still closing the stream, even on error? Thanks, Lorenz |