Archive Index
This month's Index
|
Subject: Re: Socket access (for close)
Re: Socket access (for close)
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 5 Sep 2009 20:09:14 +0200 (CEST)
On Sat, 5 Sep 2009, Peter Stuge wrote:
>> Why can't you just keep track of it and close it when libssh2 is done with
State? It's not much of a state, it's a socket the app opened so I don't see
> libssh2 design isn't perfect, but I think it's important not to tend to
I cannot see how this encourages anything like that.
> Is it really wrong for disconnect to close()? Why? If this was in fact a
Yes it is wrong, and here's my primary motivations why:
1 - we can't change behavior now without breaking ABI and I will not break ABI
2 - I argue that when the app open the socket, the app should expect to also
3 - this kind of API (you pass a socket to the library) is also provided by
4 - I don't see why a socket (in theory) couldn't be re-used for whatever
> Can libssh2 automatically detect when the socket could be reused, if ever?
How could it? It's been told to shut down a SSH session and so it does. How
-- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-develReceived on 2009-09-05 |