Open crotwell opened 3 years ago
I think it would be good to handle when doing web sockets,
Agreed. Got a repeatable test?
and maybe allow PING-PONG for normal sockets would be useful too?
That is why the ID is an exception, i.e so it can be used for pings.
Yep, what I meant was once you enable it for websockets, it should be trivial to let a regular socket use the same PING PONG messages. I agree it doesn;t really do anything that ID doesn't, just for consistency between the two types of connections.
Actually, ping-pong, because it is embedded in the websocket frame doesn't really make sense for plain sockets. Pretend I never said anything about it...
Repeatable test case would be like readdali.py
Start up an otherwise empty ringserver, edit connection params in readdali.py to connect to it (ie host and port), change line 18-19 in readdali.py so that ping_interval is not None, like ping_interval=5
run readdali.py and wait for 5 seconds, barf will occur.
Default python websockets send a PING periodically to keep a websocket connection alive. When this happens, ringserver appears to close the connection.
Would be nice if ringserver dali over websocket allowed PING-PONG.
Spec stuff here: https://www.rfc-editor.org/rfc/rfc6455.html#section-5.5.2
If not, would be good if it could log the close with a reason in the server side logging. Currently I get a disconnet but no reason or even info that that a bad command was sent:
and on the python side I get a frame error, I think because the websocket doesn't go through a normal shutdown sequence.
Note this is in STREAM mode, but where no data is flowing. The Datalink protocol says:
so techinically this is ok by websockets, but prohibited by datalink. I think it would be good to handle when doing web sockets, and maybe allow PING-PONG for normal sockets would be useful too?