1

I realised that my problem with wrapping sockets in ssl, when the socket is built from a fd is related to a socket._socketobject being converted (after rebuilding it from fd) into a socket._socket.

Is there any way to turn the socket._socket back into a _socketobject?

Thanks

LJNielsenDk
1,4601 gold badge16 silver badges32 bronze badges
asked May 24, 2013 at 16:49

1 Answer 1

4

The only solution that actually works was found in a lonely post here: http://www.velocityreviews.com/forums/t557014-socket-vs-_socketobject.html

To get a socket._socketobject from a socket._socket you need to do:

newSockObj = socket.socket(_sock=sock)

Ugly, but it works, as that post said...

answered May 24, 2013 at 17:26
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.