WebSocket: specify a non-1000 close status code on server shutdown

42 views
Skip to first unread message

Arthur

unread,
Feb 10, 2023, 4:03:39 AM2/10/23
to vert.x
Hi,

I use Vert.x server for realtime communication between multiple client using WebSocket.
In order to detect abnormally closed connection (and therefore retrying with an exponential backoff) I use the close code returned by the server when calling the WebSocketBase#close(short statusCode, String reason) method.
This works well but when the server shutdown (for a reboot or the deployment of a new version for example) the websocket is closed with a close code 1000 (which meens the websocket closed normally) instead of a 1012 (which seems to be defined for this purpose), I would like to known if there is anything I can do to change this behaviour and return a non-1000 status code.
Thank you

Arthur

Julien Viet

unread,
Feb 20, 2023, 9:14:34 AM2/20/23
to ve...@googlegroups.com
Hi,

can you open an issue and link to the specific RFC bits ?

alternatively before shutting down the server you could process all
open WebSockets and close them with the specific code using the close
method.

Julien
> Ce message et les pièces jointes sont confidentiels et établis à l'attention exclusive de leur destinataire (aux adresses spécifiques auxquelles il a été adressé). Si vous n'êtes pas le (les) destinataire(s) des informations, nous vous remercions de bien vouloir nous en informer immédiatement, de ne faire aucune copie de ce courrier, de ne pas le distribuer ou le communiquer sous aucune forme que ce soit, et de le supprimer de votre système.
>
> --
> You received this message because you are subscribed to the Google Groups "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/572468d3-914d-46c6-bd17-abb631383b44n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages