host cannot be closed if connection to server drops

Hi,

when repetier host is used together with the repetier server and I shutdown the server while repetier host was still connected to the server, then repetier host cannot be closed anymore (I have to kill the process or to be more precise do ctrl+c in the terminal from which I launched the host).

This behavior exists for a long time (I think I realized this 3 years ago or so), I never reported it since I do not think that it is particularly annoying or crucial to fix.

Here is the output of the host when the connection drops:

1/12/2021 11:24:05 PM|Fatal|<>c__DisplayClass17.<startReceiving>b__16|WebSocketSharp.WebSocketException: The header of a frame cannot be read from the stream.
                              at WebSocketSharp.WebSocketFrame.processHeader (System.Byte[] header) [0x00017] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
                              at WebSocketSharp.WebSocketFrame+<>c__DisplayClassa.<readHeaderAsync>b__9 (System.Byte[] bytes) [0x00000] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
                              at WebSocketSharp.Ext+<>c__DisplayClass9.<ReadBytesAsync>b__8 (System.IAsyncResult ar) [0x000a2] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
1/12/2021 11:24:06 PM|Fatal|WebSocket.connect|System.Net.Sockets.SocketException (0x80004005): Connection refused
                              at System.Net.Sockets.TcpClient..ctor (System.String hostname, System.Int32 port) [0x0006d] in <2b0d86369d72459baed0cee98a8e578a>:0
                              at WebSocketSharp.WebSocket.setClientStream () [0x0006b] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
                              at WebSocketSharp.WebSocket.doHandshake () [0x00001] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
                              at WebSocketSharp.WebSocket.connect () [0x0004d] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
1/12/2021 11:24:06 PM|Error|WebSocket.Send|This operation isn't available in: closed
1/12/2021 11:24:07 PM|Error|WebSocket.Send|This operation isn't available in: closed
1/12/2021 11:24:08 PM|Fatal|WebSocket.connect|System.Net.Sockets.SocketException (0x80004005): Connection refused
                              at System.Net.Sockets.TcpClient..ctor (System.String hostname, System.Int32 port) [0x0006d] in <2b0d86369d72459baed0cee98a8e578a>:0
                              at WebSocketSharp.WebSocket.setClientStream () [0x0006b] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
                              at WebSocketSharp.WebSocket.doHandshake () [0x00001] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
                              at WebSocketSharp.WebSocket.connect () [0x0004d] in <38d3cef14c5a4fc9a92de0991034bc1a>:0
1/12/2021 11:24:09 PM|Error|WebSocket.Send|This operation isn't available in: closed
1/12/2021 11:24:09 PM|Error|WebSocket.Send|This operation isn't available in: closed

Version 2.1.6
Ubuntu 20.04

Comments

  • Good timing, with server released now updating host is my next step. So will try to reproduce and fix if possible.
  • You posted this in linux group - does that mean you have the problem under linux? Windows might behave different so need to know where to test.
  • yes, Ubuntu 20.04.
    If I remember correctly windows did not have this issue, but that was 3 years ago.

    Should I test with a new version of the server?
  • Don't think new server version helps. I think the exception due to websocket prevents close in host, so that must be fixed in host.
  • After updating to a newer websocket version it seems to work. So will be solved in 2.2.0
Sign In or Register to comment.