[Ecls-list] Closing BSD-SOCKET when a stream has been created
Juan Jose Garcia Ripoll
lisp at arrakis.es
Mon Feb 14 06:49:29 UTC 2005
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.
More information about the ecl-devel