Closed notomo closed 6 years ago
@roxma I think it should be merged. Can you merge it?
The default timeout seems to be 2s. It should be enough for program initialization. Why does it need inifinite timeout?
The main server should have already started at this line, If ch_open gets an error, It’s another issue
@roxma http://vim-jp.org/vimdoc-en/channel.html#waittime According to doc, "waittime" option doesn't wait by default. (2s is "timeout" option's default)
Thread already started when neovim_rpc_server.start() finished, but tcp server is not always ready. This pull-request is very simple solution. Maybe this is not the best solution.
hmm...
It seems the issue only happens on windows. If I add a delay before serve, it still works on my PC.
def foo():
import time
time.sleep(1)
_vim_server.serve_forever()
# Start a thread with the server -- that thread will then start one
# more thread for each request
main_server_thread = threading.Thread(target=foo)
clients_server_thread = threading.Thread(target=_nvim_server.serve_forever)
Thread already started when neovim_rpc_server.start() finished, but tcp server is not always ready.
According to the doc of winsock-listen, which is called when TCPServer
is constructed, the system should have started queueing connection requests when ch_open
is called.
I don't understand why it doesn't work on Windows.
https://github.com/notomo/tmp-appvoyer-test https://ci.appveyor.com/project/notomo/tmp-appvoyer-test/build/8
I made test repository and tested on appveyor Windows.(python2) I tested default waittime and infinite waittime, but the result was the same. The problem seems to be caused by my environment.
Thank you for your time.
By default,
ch_open
doesn't wait opening the channel. Under my environment(Windows 10, gvim),neovim_rpc#serveraddr
getsE906: not an open channel
error. This change solves the error.