aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes URGENT!!! 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 "URGENT!!!" Watch "URGENT!!!" New topic
Author

URGENT!!!

Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
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.



Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
Ali Hassaan
Ranch Hand

Joined: May 16, 2001
Posts: 103
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

Joined: Oct 10, 2001
Posts: 2
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

Joined: Jan 12, 2001
Posts: 641
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


Raghav.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URGENT!!!