I am trying to get Autobahn.Python to work with connecting and disconnecting without having to restart the program.
I have taken the default message based tutorial and modified it to send messages then attempt to disconnect the websocket. In the protocol class, when I have sent a message to the server and the server sends the response, I call “dropConnection” or “sendClose” methods (not sure which is more correct). The call realizes in a connection lost signal to the server and it disconnects.
However, now the client is stuck waiting on the call “reactor.run()”. If I call “reactor.stop”, the “run” returns. But now I can’t call “reactor.run” anymore as it throws an exception that the reactor cannot be restarted.
How do you get Autobahn to drop and reconnect websocket connections at some later date?