• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URGENT!!!

 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.........
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic