This is server program.
akila sekaran wrote:I have this chat room application where in multiple clients can chat simultaneously. How do i make it a one to one chat application ?
This is client program...
Winston Gutkowski wrote:
akila sekaran wrote:I have this chat room application where in multiple clients can chat simultaneously. How do i make it a one to one chat application ?
This is client program...
Akila,
1. That is a vast amount of code to go through. Can you localize your question a bit? What have you tried?
2. I've shortened some lines and broken up one because they're too long. Please re-read the UseCodeTags page thoroughly before you post new code or edit this.
Winston
akila sekaran wrote:Okay as you said i have removed client class which had no purpose here.. here i am using a arraylist to process multiple clients. my question is how do i modify this program to have just two people chatting among themselves?
Winston Gutkowski wrote:
akila sekaran wrote:Okay as you said i have removed client class which had no purpose here.. here i am using a arraylist to process multiple clients. my question is how do i modify this program to have just two people chatting among themselves?
Well I'm no expert on this stuff, but if you already have your app working (and I hope it's using Lists, not ArrayLists, BTW; and if it isn't, get that fixed first), just create a List class of your own that can take a limit (ArrayList isn't final, so you could just extend it), and doesn't allow any more elements to be added after that.
Then, your "single" chat just applies a limit of 1 (or 2, depending on how it's used) to the Client List.
Winston