7
Storing connected clients - websockets
(programming.dev)
Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development
Web development is the process of creating websites or web applications
Some webdev blogs
Not sure what to post in here? Want some web development related things to read?
Heres a couple blogs that have web development related content
Don't think the size really matters... an IP is 4 bytes, and the port another byte, plus lets say 4 bytes for the UserId. So with some overhead, you can practically put about 100k addresses in 1 MB.
With that many addresses, you should probably be more concerned about the lookup than the storage. I'd probably put then in a Dictionary[UserId, SocketData].
Websockets don't usually stay alive for long periods, so there's not much point of storing them in a database. Unless you're building something serverless, but then I wouldn't build something myself, but just use Firebase Cloud Messaging instead