This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-23
Channels
- # announcements (2)
- # atom-editor (3)
- # babashka (49)
- # beginners (100)
- # biff (9)
- # calva (78)
- # clj-kondo (18)
- # clojure (143)
- # clojure-europe (13)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (58)
- # conjure (1)
- # cursive (4)
- # datascript (11)
- # datomic (63)
- # docker (7)
- # emacs (18)
- # events (1)
- # fulcro (18)
- # graalvm (5)
- # helix (4)
- # improve-getting-started (13)
- # jobs (4)
- # jobs-discuss (3)
- # lsp (15)
- # malli (90)
- # membrane (14)
- # off-topic (12)
- # other-languages (5)
- # pedestal (7)
- # polylith (53)
- # re-frame (15)
- # reitit (23)
- # releases (4)
- # remote-jobs (9)
- # ring (11)
- # shadow-cljs (90)
- # specter (2)
- # testing (3)
- # tools-build (63)
- # vim (2)
- # xtdb (8)
Anyone worked with websockets in golang ? I want to have a central hub, and have multiple clients connect over websockets so the clients can be sent commands. As I understand it, even with gorilla, I need to manage keeping track of who is connected and the routing myself? i.e. On connection, I'll send client name in the request, then I can keep a hashmap keyed on name and value of the websocket connection. Then I have to ping / pong messages essentially saying "I'm alive", then have a goroutine in the background check when the last ping was received from each client, and remove them from the map. DOes this sound right? Anyone used any good packages that manage most of this for me ?
not go specific, but I've worked with websockets some, and I would, if possible, listen to the state of the underlying tcp connection, and go off that being open or closed, secondly use websockets built in ping frames, and maybe thirdly do by application level ping pong
we use a framework at work that does something like this, it does its own ping/pongs, and keeps a map of uuids to websocket connections, but we found that it leaked, so we ended up with our own background thread that goes through the map from time to time and checks the state of the tcp connection and removes things as neeed