Subject: Re: Socket access (for close)

Re: Socket access (for close)

From: Tor Arntsen <tor_at_spacetec.no>
Date: Mon, 7 Sep 2009 13:24:51 +0200

On Sat, Sep 5, 2009 at 20:09, Daniel Stenberg<daniel_at_haxx.se> wrote:

> 2 - I argue that when the app open the socket, the app should expect to also
>    close it (at the least as default behavior). Another behvior would be
>    unexpected and a layering problem.

I'm coming in late here (I've been away), but for what it's worth I
strongly agree with the above. Don't open a socket in one layer and
close it in another, it's unbalanced, unclean, and just generally bad
design. If the application opens the socket, or file, or anything,
then the appliacation layer must also be responsible for closing it.
If the socket were opened in the library layer, _then_ the library
layer should close it. It should not close something that the
application layer opened.

-Tor
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-09-07