I like the simplicity and the fact you list the edge cases that may cause inaccuracy.
I wonder what the consensus is on polling a same-host endpoint as a ping (by updating the response with the current timestamp) to check the connection can at least reach the remote destination
With WebSocket, this becomes slightly less important due to the connect and disconnect events firing as expected so long as reconnect is configured.
A skilled software engineer, talented problem-solver and team player with a passion for using technology to solve complex problems and constantly seeking out new challenges to advance my skills👨🏼💻
Polling is a good way, but to use it as an alternative to the listeners we will have to poll very frequently.
I prefer to use the listeners as those side cases are not so impacting. After a false-positive result, if we send a valid request and it fails, we will get to know about the false-positive status. At last, it depends on the application and it's working.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I like the simplicity and the fact you list the edge cases that may cause inaccuracy.
I wonder what the consensus is on polling a same-host endpoint as a ping (by updating the response with the current timestamp) to check the connection can at least reach the remote destination
With WebSocket, this becomes slightly less important due to the connect and disconnect events firing as expected so long as reconnect is configured.
Polling is a good way, but to use it as an alternative to the listeners we will have to poll very frequently.
I prefer to use the listeners as those side cases are not so impacting. After a false-positive result, if we send a valid request and it fails, we will get to know about the false-positive status. At last, it depends on the application and it's working.