# Phoenix Socket draining

**URL:** <https://forum.elixirforum.com/t/phoenix-socket-draining/46751>\
**Category:** Questions\
**Tags:** phoenix, websockets\
**Created:** [March 22, 2022, 5:45pm UTC](https://forum.elixirforum.com/t/phoenix-socket-draining/46751 "2022-03-22T17:45:21Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![rjk](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rjk/32/1293_2.png) [@rjk](https://forum.elixirforum.com/u/rjk)\
**Post date:** [March 22, 2022, 9:18pm UTC](https://forum.elixirforum.com/t/phoenix-socket-draining/46751/6 "2022-03-22T21:18:39Z")

</div>

Presence.track can store key/values so you could store hostname and userid? So on a quit signal do a lookup on hostname and you have a list of connected sockets for that node? And you could use [Phoenix.PubSub — Phoenix.PubSub v2.2.0](https://hexdocs.pm/phoenix_pubsub/Phoenix.PubSub.html#local_broadcast/4) to keep the broadcast local to the node.

---

_[View the full topic](https://forum.elixirforum.com/t/phoenix-socket-draining/46751)._
