• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Multithreaded Chat server (Rooms Creation)

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Friends .
Can any body explain me how to create Private Room in java Chat server application . actually i am making a chat server application which has a 5 (five ) chat room ,but i couldn't understand how i can do that. This five chat room will display of total no of USERS Currently present in each rooms

Thanx in Advance
Deepak
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
Try to use MulticastSocket which helps to have private chat rooms...
Refer book Java2 DevelopersGuide....for further details...
bye,
ram
 
DeepakB
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ram

Thnx for nice advice but i am using TCP/IP connection & getting communicat with server using server socket, clint socket..., any one can plz explain more.

Thnx
Deepak
 
Ranch Hand
Posts: 477
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"DeepakB",
your name is not valid as per the Javaranch name conventions. Please refer to the document located here
 
Ramalingam Vijayakumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello deepak,

I have a solution for you problem...
Since it is a multithread server....
Keep seperate vector for each client who joins in a particuler room....

1.The steps are as follws..
GIve an option in the client to which room he/she is willing to join at the time of signing....

2. when he makes a connection.....get the room name and store his reference(ie socket refernce in a vector)...
3. when ever you want to send any msg to that room....

4. take the client details out of the vector...(Socket Details) and the send the msg through the socket output stream...
5. This is how I have done a multithread chat server using ConnectionOriented Service(TCP)
6.mail me if you still have any doubts.....

bye,
ram..

 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic