jcelliott / turnpike

Go implementation of a WAMP (Web Application Messaging Protocol) client and router
MIT License
258 stars 88 forks source link

How can a client know if the webosocket has disconnected? #137

Open subiol opened 7 years ago

subiol commented 7 years ago

I can see the router has AddSessionOpenCallback and AddSessionCloseCallback, but I have not found anything similar for the client. Is there a way for a client to know if the underlying websocket has disconnected for whatever reason?

beatgammit commented 6 years ago

If it closes normally, you'll get a message saying as much, but if it closes abnormally (socket died), I don't think there's anything currently in the source to hook into that.