Closed fregante closed 10 years ago
This is a known bug, due the simplicity of this "proof of concept".
The WebSocket server runs single threaded which means only one textarea can communicate with SublimeText. By closing the connected textarea's browser tab the server should normally restart and listen for the next connection.
If the socket is still in use and you are using Linux, try a lsof -i :1337
for finding the blocking process.
I'm currently planning a new Version of SublimeTextarea with multi connections support…, you have to be patient until this Version sees the light of day.
It's in use by the package itself, via Sublime's plugin_host
Unfortunately if I close the tab I see that Connection reset by peer
error and it won't connect any more.
This is a great proof of concept by the way, I see myself using this all the time. :+1:
I'm not sure where the issue was, I should have pasted the full call stack.
Now it seems to be working:
Setting on message handler
Start
Setting on message handler
Stop
Triggering on_close
Setting on message handler
Start
Setting on message handler
…
I don't know, it happened again, once.
Exception in thread Thread-5:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "X/threading.py", line 596, in run
File "SublimeTextarea in /Users/bfred/Library/Application Support/Sublime Text 3/Installed Packages/ChromeTextArea.sublime-package", line 64, in web_socket_server_thread
File "WebSocket.Server in /Users/bfred/Library/Application Support/Sublime Text 3/Installed Packages/ChromeTextArea.sublime-package", line 39, in start
ConnectionResetError: [Errno 54] Connection reset by peer
I restarted ST and it worked. :frowning:
Should be resolved with the multi connection support.
Is there a way to disconnect and move to a different textarea? ST console when I close Chrome's tab:
Chrome's console when I try connecting to a new textarea
Right now the only way to disconnect a work on a new textarea is by closing Sublime. Even disabling+enabling the package is not enough. ST console when I re-enable the package.