Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Viewing Clients In A chat program  RSS feed

 
Zeeshan Hayat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have developed a Chat program using ServerSocket and Simple sockets. I want to view the users in the ClientGui JList. Could Anyone help me with that, Below is the source code for the application.
The source code can be seen at
http://geocities.com/zeeshan_azeemi/javaChat.zip
Thanx in Advance
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you already have a collection of user IP address in users[]. Your ServerThread could accept a special message (like .who) that means send me back the current list of users. Then a user could ask for the list and see it in his message window.
Or your server could push the complete list to all clients every time somebody logs on. Again, start the message with something special like .who and the client program could identify the message and display it in a side window.
Any of that sound useful?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!