Closed noway closed 7 years ago
@aresch could you have a look at this?
I'm a little confused on the point of hiding the fileno() method, but I'd be more inclined to just remove it then trying to add a compile option to hide it since I'm not convinced its particularly useful. Also, I'm not sure why the FAST_CONNECT_DROP needs to be a compile-time option. It could probably just be added as an kwarg to Host.init or even just to the service() method. I think that doing this would reduce the complexity of this change.
HIDE_SOCKET_FILENO is indeed pretty redundant and I would go without it. I'd simply forego this option as because it is pretty useless.
Re: kwargs to Host.__init__
: sounds like a great idea, definitely something I'd go with.
Superseded by #9
Enables to hide Socket.fileno function (from external SDK for example, so it wouldn't be possible to abuse the underlying Socket connection instead of using intercept callback properly)
As well as fast Connect Drop where it can return None instead of the event on disconnect of the peer.
Enabled through compile time options in setup.py.
Tested it with py2k and py3k, works fine.
Voice the concern if you have any :-)