DEV Community

loading...

Discussion on: First Ever DEV Contest: Build a Realtime App with Pusher

kayis profile image
K • Edited

Is there a way to close user connections on the server?

Thread Thread
zmarkan profile image
Zan Markan

I'll double check but I don't think so.

You could send a message to a particular user that you wish to disconnect and handle that clientside.

What is your use-case for this?

Thread Thread
kayis profile image
K

I want to use presence channels for games. When a game is finished, the users should be removed from the channel.

Thread Thread
zmarkan profile image
Zan Markan

Ah yeah - just send a message that tells the clients to unsub from the channel, that should be the best way.

I've asked the team working on Channels and we don't support terminating connections from the server.

Thread Thread
kayis profile image
K

Well, guess for this contest it should be enough, thank you.