taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.74k stars 193 forks source link

5000ms delay in sending websocket messages #310

Closed Hendekagon closed 1 year ago

Hendekagon commented 6 years ago

I'm using a basic Sente-enabled client and server setup:

(chsk-send! [:ping {:sent (.now js/Date)}]
    1000000
    (fn [r] (println "  <reply" r)))

and on the server:

(defmethod -event-msg-handler :ping
  [{reply :?reply-fn [_ {ms :sent}] :event :as message}]
  (info "ping message" (str (:event message)))
  (reply {:sent ms :replied (System/currentTimeMillis) :dt (- (System/currentTimeMillis) ms)}))

and there's a delay of around 5000ms before the client sends the message if you leave the client (no messaging) for a couple of minutes. Thereafter messaging is fast, but leave the client for a couple of minutes and the first message will be delayed by around 5000ms before being sent.

ptaoussanis commented 1 year ago

Closing old issue as part of triage. If this issue is still relevant with a recent version of Sente, please feel free to re-open!