Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSockets: all client related processes are not properly destroyed in some cases #46

Open
gbour opened this issue Jul 13, 2016 · 0 comments
Labels

Comments

@gbour
Copy link
Owner

gbour commented Jul 13, 2016

when a client close its websocket connection without proper MQTT DISCONNECT, or when MQTT connection timesout:

  • mqtt_ranch_protocol process is not destroyed
  • mqtt_session and wave_websocket processes are destroyed after MQTT timeout (*1.5) only

Explanation:

  • when a client connects with WebSocket transport, 4 processes are created to handle client connection
    • wave_websocket_handler (a ranch listener) to receipt ws packets
    • mqtt_session is the MQTT FSM
    • mqtt_ranch_protocol is the generic low-level mqtt packets reader/writer
    • wave_websocket emulates a gen_tcp like socket by linking mqtt_ranch_protocol with wave_websocket_handler

when client disconnects properly (sending MQTT DISCONNECT PACKET), all 4 processes are properly destroyed (in order mqtt_session -> wave_websocket -> wave_websocket_handler & mqtt_ranch_protocol).
But if client just close socket or let's mqtt session timeout, this is not done properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant