Skip to content

How to detect client connection state? #1832

Answered by kitten
nicolaiunrein asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure if you're referring to subscription transport libraries here, but if you mean, let's say, graphql-ws, then you'll instantiate their client first, which means that it then is responsible for describing its connection state. Last time I checked I wasn't sure whether they implemented a ping system to detect the connection state, but in either way, it's actually a more complicated problem than it sounds.

If you use WebSockets, then you'll have to note that they're built to try to retain "broken" connections for as long as possible, so they can recover on unstable internet connections. That means, depending on the network conditions, even if they drop ACK packets, as far as I know…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nicolaiunrein
Comment options

Answer selected by JoviDeCroock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants