rsub + sublime的奇怪行为

时间:2018-11-24 18:43:34

标签: python sockets sublimetext

我在raspberrypi(jessie)上的rsub(1.0.2)连接有问题。在尝试连接sublime-text(2-3)服务器时,它挂在第241行上:

241:    self._socket = socket.create_connection((host, port))

,输出为:

me@raspberrypi:~ $ rsub empty.txt  //hangs forever.. no connection with sublime

我确定sublime,ssh,ip,ports配置正确。 我为该功能添加了5秒超时:

241:    self._socket = socket.create_connection((host, port), 5)

,输出为:

me@raspberrypi:~ $ rsub empty.txt  //hangs for 5 sec
me@raspberrypi:~ $                 // After 5 sec, connection is established with sublime.

我可以编辑并保存,但仅在接下来的5秒钟内!在那之后,我得到了一个Traceback(当然会丢失连接)

me@raspberrypi:~ $ Traceback (most recent call last):
  File "/usr/local/bin/rsub", line 410, in <module>
    main()
  File "/usr/local/bin/rsub", line 402, in main
    client.listen()
  File "/usr/local/bin/rsub", line 279, in listen
    for line in self._readlines():
  File "/usr/local/bin/rsub", line 345, in <genexpr>
    return (line.decode('utf-8').strip() for line in self._rfile)
  File "/usr/lib/python3.4/socket.py", line 371, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

我真的不知道发生了什么。 有谁知道如何解决或调试这种情况?

0 个答案:

没有答案