Floobits / floobits-sublime

Floobits real-time collaboration plugin for Sublime Text 2 and 3
Apache License 2.0
294 stars 31 forks source link

Update readme with correct info #215

Closed wbond closed 9 years ago

wbond commented 9 years ago

I've updated your readme with useful info for ST2/Windows and Linux users. I also fixed the Package Control link.

btipling commented 9 years ago

Wow thanks!

wbond commented 9 years ago

I should note that I believe you need to change floobits.py to try and import select before failing with an error on ST2/Windows,

ggreer commented 9 years ago

Thanks for the PR. I changed our plugin to correctly detect the select module. Unfortunately, ST2 on Windows is still unusable. It looks like it can only do blocking reads on the socket, which causes ST2 to freeze until it's disconnected for inactivity. I'll have to look into this more.

wbond commented 9 years ago

I believe you are hitting the lockup due to these lines: https://github.com/Floobits/floobits-sublime/blob/master/floo/common/protocols/floo_proto.py#L281-L290.

Right after select.select() returns a valid socket to read, https://github.com/Floobits/floobits-sublime/blob/master/floo/common/reactor.py#L141 is called. That method enters the while True loop (https://github.com/Floobits/floobits-sublime/blob/master/floo/common/protocols/floo_proto.py#L281-L290) and reads a value. Then it tries to read again (since the condition is True) and hangs for 15 seconds. I added a select.select() call into the while True loop and that seemed to prevent the hang.

My guess is that the socket module in Python 2 on Windows isn't as polished as Python 3, or posix platforms. Can't say I know for sure. In situations where I had to deal with similar stuff to this (reading data from psftp.exe on Windows), I used a thread that read a blocking file handle and used a queue to allow for non-blocking reads from the rest of the plugin.

ggreer commented 9 years ago

We worked around the Windows PY2 weirdness. Your instructions are valid now. Thanks.