It sounds like you're struggling a little bit with socket architecture. Each socket pair in your architecture will be determined by a unique pair of IP addresses. Wikipedia says:
Communicating local and remote sockets are called socket pairs. Each socket pair is described by a unique 4-tuple consisting of source and destination IP addresses and port numbers, i.e. of local and remote socket addresses.3[4] As seen in the discussion above, in the TCP case, each unique socket pair 4-tuple is assigned a socket number
Additionally, according to this stackoverflow answer:
Simply, if I connect to the same web server twice from my client, the two connections will have different source ports from my perspective and destination ports from the web server's. So there is no ambiguity, even though both connections have the same source and destination IP addresses.
Your peer-to-peer chat client network can definitely work, and clients can indeed syndicate messages that they've received to other clients. Most likely you will want to tag each message with a GUID so that clients do not process the same message multiple times.
Perhaps a more useful architecture would be a pub/sub architecture. Realtime networks such as PubNub allow you to publish messages to global channels, and receive those messages on clients subscribed to that channel. In your case, using their Java SDK, publishing a message is as simple as:
Callback callback = new Callback() {
public void successCallback(String channel, Object response) {
System.out.println(response.toString());
}
public void errorCallback(String channel, PubnubError error) {
System.out.println(error.toString());
}
};
pubnub.publish("demo", "Hello World !!" , callback);
I hope this helps. Cheers!