This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am currently working on an instant messaging chat application and was wondering how the flow of communication should go between Client A and Client B
My initial thought was to have Client A & B connect to Server A and pull down the connection information (IP's, Ports, etc..) for their "buddies". at this point Clients A & B would be able to iniitiate a direct connection between themselves, leaving Server A out of it. Server A would periodically broadcast changed data to clients but thats about it. It would be the clients responsibility to manage its connections (chat sessions). Might run into some difficulties doing this with firewalls, routers, etc...
or... all communication between Clients A & B must pass through Server A before that communication is passed on to Client B, making Server A the manager of all connections (chat sessions). This is definitly more overhead for the Server and more hops means more points of failure. But, this drasticaly reduces the potential issue stemming from Firewall/router issues.