• Post Reply Bookmark Topic Watch Topic
  • New Topic

chat room application  RSS feed

 
akila sekaran
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 server program.


 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


hi,
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?
 
Paul Clapham
Sheriff
Posts: 22841
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Find the part of the code which allows the server to handle more than one client. Then modify that code so it only handles one client.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
akila sekaran
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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



thanks for the reply. I have written a new simple one.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!