Antoine Pitrou <pit...@free.fr> added the comment:

I have tried refactoring the ssl code in order not to inherit from socket 
anymore, but it turned out suboptimal because chunks of code from the socket 
class then have to be duplicated.

Therefore, I instead propose a much simpler approach which is to add a forget() 
method to socket objects; this method "closes" the socket object (sets the 
internal fd to -1) without closing the underlying fd at all. This allows to 
create another socket (actually SSLSocket) from the same fd without having to 
dup() it.

Here is a patch; if the principle is accepted, I will add tests and docs.

----------
keywords: +patch
nosy: +loewis
Added file: http://bugs.python.org/file17723/sockforget.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8524>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to