Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap socket type with a class instead of a function. #58

Merged

Conversation

JustinTArthur
Copy link
Contributor

By wrapping the socket.socket type with a function, we've been emulating only the wrapped type's constructor and not the wrapped type itself. This won't work if we wish to enable long polling for SOCKS connections with the SocksiPy library as this library imports and attempts to construct a class that inherits from the socket.socket type.

Original wrapper function was added in 6cf0bc7, but the issue this pull request attempts to address was triggered by a change in module import order in a5ab744, where SocksiPy wraps poclbm's own socket wrapper, where before it had been wrapping the system-provided socket type. This pull request addresses #56. If we don't need long polling on SOCKS, live-mining/poclbm@ce05212c53a30386da94a5aebd1d581d5421a354 is also a fix for the immediate issue described in issue 56.

By wrapping the `socket.socket` type with a function, we've been emulating only the wrapped type's constructor and not the wrapped type itself. This won't work if we wish to enable long polling for SOCKS connections with the SocksiPy library as this library imports and attempts to construct a class that inherits from the `socket.socket` type.

Original wrapper function was added in 6cf0bc7, but the issue this commit attempts to address was triggered by a change in module import order in a5ab744, where SocksiPy wraps poclbm's own socket wrapper, where before it had been wrapping the system-provided socket type. This commit addresses m0mchil/poclbm#56.  If we don't need long polling on SOCKS, live-mining/poclbm@ce05212c53a30386da94a5aebd1d581d5421a354 is also a fix for the immediate issue.
m0mchil added a commit that referenced this pull request Apr 1, 2013
…-socket-type

Wrap socket type with a class instead of a function.
@m0mchil m0mchil merged commit ee85212 into m0mchil:master Apr 1, 2013
@m0mchil
Copy link
Owner

m0mchil commented Apr 1, 2013

Thanks, that is what I intended too.

@JustinTArthur JustinTArthur deleted the issue-56-improperly-wrapped-socket-type branch January 17, 2018 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants