I’m working on a chat server, and I’m putting the Clients into a Hashtable.
This Hashtable is composed by <String name, Connection c>, where Connection has Socket and in-out flows.
I can send messages just looking for a nick in the Hashtable, but how can I send it to all the people?
Can I “Scout” (this was the unknown term) every Hashtable’s entry? (like an array, I want to “SCOUT” each entry, so I’ll do a loop and I’ll send the message to everyone).
Thanks in advance.
Then do the same for all nicknames in the hash table:
or, alternatively: