1 Replies - 1359 Views - Last Post: 07 March 2012 - 04:55 AM Rate Topic: -----

#1 Chris12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-March 12

Problem: Client/Server communication.

Posted 07 March 2012 - 04:41 AM

I'm working on a chat application where I have two Clients and a Server. I can get them to connect and communicate, but the problem is if Client A send is sending a message to Client B, the server sends that message to both Client A and B and vice versa.

Is there a way that Clients A's message is only delivered to Client B, and Client B's message only to Client A?

I have tried to compare the original messages with the receiving one, but it's not good when both Clients sends the same message.

Is This A Good Question/Topic? 0
  • +

Replies To: Problem: Client/Server communication.

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8378
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Problem: Client/Server communication.

Posted 07 March 2012 - 04:55 AM

Without seeing your code not easy to answer.
You must be listening from each Client on different threads, so have a way to identify that Client on it's own Thread and do not reply to it

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1