Skip to content

WebSocketSubject: Keep-Alive and messages queue #5175

Open
@aranz00

Description

@aranz00

Hi mates,

i implemented keep-alive with ping pong pattern for check the connection state (because in some situation websocket believes to be connected but it really is not (for example by disconnecting the network cable). When client websocket send a ping to server, the server send a pong so client can know if the trasport channel is really up. In the event that the client does not notice that it is disconnected instead it send a ping and no pong receive (because server is unreachable) safter a while the client tries to postpone another ping and retry so on... so many ping are queued in WebSocketSubject queue (destination is a ReplaySubject unlimited). So when server come up, client send all ping queued :(

Is there a way not to queue the pings in the queue? I see destination parameter in WebSocketSubject ctor but i don't know ad is works. Can you help me? Can i send a message without appending it in the queue?

Thank you

Version:
"rxjs": "^6.5.3",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions