aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes IM Chat Client/Server flow? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "IM Chat Client/Server flow?" Watch "IM Chat Client/Server flow?" New topic
Author

IM Chat Client/Server flow?

Rob Poulos
Ranch Hand

Joined: Aug 21, 2009
Posts: 49
hopefully this is the right forum for this

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.

your thoughts?


SCJA, ITIL V3 Foudation, Studying for SCJP6
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Your "initial thought" is a common "peer-to-peer" networking scheme. Your second thought is a typical "client-server" scheme. They're both valid ways to implement a network application.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: IM Chat Client/Server flow?