Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chat Programming.

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I want to write a chat program where there are basically a server and many clients., I would be much appriciated if you guys give me some ideas,
Thank you very much.......
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In high level terms consider this option. The Client and Server programs both open ServerSockets and act as clients to each other. If this is a bit confusing at first, do some simple tutorials on socket clients & servers, or find a friend and role-play the two machines.

Lots of moving parts, no? And I left out any way to log out. The client might tell the server it is logging out so the server can remove the client from the list of logged in clients. Or the server might try to connect to a client and fail, meaning the client is no longer running. That would be a sign to remove the client from the list of logged in clients, too.
Hope that helps!
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
Thank you very much for the reply. I did figure out how to do the task, It is interesting. I am enjoying the programming.
Thank you very much for helping.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic