postgres-websockets icon indicating copy to clipboard operation
postgres-websockets copied to clipboard

Need ping/pong functionality

Open cwangfr opened this issue 2 years ago • 4 comments

The environment I use is a mobile network, and the connection is always unstable. Is it possible to provide the function of client PING and server response to PONG, which is convenient for the client to do heartbeat detection. Or is there already a similar function? thank you very much.

cwangfr avatar Jun 19 '22 21:06 cwangfr

@cwangfr the server currently has no such feature. Just to ensure I understood correctly, you would like to initiate the ping test on the client side, is that correct?

diogob avatar Jun 20 '22 15:06 diogob

@diogob yes, that's what i need

cwangfr avatar Jun 20 '22 21:06 cwangfr

I wonder @cwangfr , could this be implemented in postgres? maybe using something like https://github.com/diogob/pg-recorder to listen for a PING message, and respond with a PONG

jamesmstone avatar Aug 22 '22 00:08 jamesmstone

@jamesmstone @cwangfr that is a neat idea. It seems like the sort of functionality that would be well suited for a companion project. Perhaps we could even revamp the pg-recorder project and bake some useful functions in the project. I won't have much time to dedicate to this project but I'm more than happy to review PRs and give any pointers needed.

diogob avatar Aug 23 '22 17:08 diogob