Interesting, thanks!

I actually looked for something like that but seem to have overlooked it. I
saw :chsk/closed but not :chsk/close

It seems that both chsk-reconnect! and :chsk/close events will let the
client control its connection state, but there doesn't seem to be any way
for the server to do so. I guess this makes sense, since the client is the
one doing the connecting. Still, I'd like the server to be able to sever
connections, although its not a big deal since I can have the server send
an event to tell the client to do so.


On 24 August 2014 22:40, Sam Ritchie <sritchi...@gmail.com> wrote:

> I think you can send :chsk/close:
>
>
> https://github.com/ptaoussanis/sente/blob/master/src/taoensso/sente.cljx#L335
>
> This doesn't look documented either, but according to the code it'll do
> the trick.
>
>   Daniel Kersten <dkers...@gmail.com>
>  August 24, 2014 at 11:30 AM
> After some more digging[1], I see that the client can call 
> (sente/chsk-reconnect!
> <my-chsk>) to disconnect (and then reconnect) a connection.
> Looking at the comments in the code[2], it does this by closing the socket
> and then it gets auto-reconnected. I guess that means its not possible to
> disconnect without automatically reconnecting, but for now this behaviour
> is sufficient for me.
>
> Hopefully this is useful to others, as I don't see chsk-reconnect!
> documented anywhere.
>
> [1] https://github.com/ptaoussanis/sente/issues/63 and
> https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L555
> [2]
> https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L632
> and
> https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L732
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>   Daniel Kersten <dkers...@gmail.com>
>  August 24, 2014 at 11:06 AM
> Hi,
>
> I'm trying programmatically close a connected sente connection (either on
> the server or the client).
>
> Is this possible?
>
> Thanks,
> Dan.
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> Sam Ritchie (@sritchie)
>  Paddleguru Co-Founder
> 703.863.8561
> www.paddleguru.com
> Twitter <http://twitter.com/paddleguru> // Facebook
> <http://facebook.com/paddleguru>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to