Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multithreaded Chat server (Rooms Creation)  RSS feed

 
DeepakB
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
 
Ramalingam Vijayakumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Marcela Blei
Ranch Hand
Posts: 477
  • Mark post as helpful
  • send pies
  • 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
  • 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..

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!