Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URGENT!!!

 
Vikrama Sanjeeva
Ranch Hand
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am developing a chap application which i have to submit after a
day.So plz. reply me soon.
Problem is that, Client A wants to chat with Client B and vice versa.This will be done as follows,
1:Client A first send message to Server then Server will send message to Client B.
In my programe Client A is sending message to Server But Server is not giving sending message to Client B.
How it will be done.Remember my server is dealing with multiple clients using threads.
Viki.

 
Ali Hassaan
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You have to manage a vector on server in which u store all login users ids and in your case when A send message to B first server application checks in its userlist vector and then call its thread and send message.........
 
RIFAQUAT, AHMED
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now viki do one thing create an object of hashtable class available in java.util.Hashtable n then put all the Socket's out stream and socket in hastable after that u can manage it.
h.put(socket's stream,socket s);
do this n then get n enumerationg after the client request.
Remember use pooling other wise situation of dead lock may occur.
 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Hassaan:
Hi,
You have to manage a vector on server in which u store all login users ids and in your case when A send message to B first server application checks in its userlist vector and then call its thread and send message.........

Hi ali
When the client connects to the server , then how does the client see's the list of connected cients on the server which are stored inside a vector or a hash table.
Does the server sends the vector object to the client for making a selection?
Please guide me a bit
Thanks in advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic