[Ecls-list] Closing BSD-SOCKET when a stream has been created

Julian Stecklina der_julian at web.de
Mon Feb 14 07:20:33 UTC 2005


On Mon, 14 Feb 2005 15:48:48 +0100
Juan Jose Garcia Ripoll <lisp at arrakis.es> wrote:

> Let me restate the problem:
> 
> 1. SOCKET-CLOSE does not behave properly because it either close the 
> streams or the file descriptor, but not both.
> 2. When closing a TWO-WAY-STREAM, the components are not closed. It 
> happens that socket streams are of this type, and thus closing the 
> stream does not lead to immediate closing of the file descriptor 
> associtated to the socket.
> 
> The fact that socket streams are two-way-streams is no problem. I have
> 
> recoded SOCKET-CLOSE so that it closes _both_ the composite stream and
> 
> the file descriptor. The stream-elements from the two-way stream need 
> not be closed explicitely, since their associated file descriptor has 
> been closed anyway.
> 
> Now the behavior during garbage collection is as follows. If the
> socket  structure is garbage collected, the streams that form part of
> it will be  eventually unreferenced and garbage collected as well.
> This will lead to  the file descriptor being closed.

Another problem is that the current behavior is inconsistent with SBCL's
behavior, where close on the stream closes the file descriptor
immediately. This might introduce problems when porting software.

Regards,
-- 
                    ____________________________
 Julian Stecklina  /  _________________________/
  ________________/  /
  \_________________/  LISP - truly beautiful




More information about the ecl-devel mailing list