• Post Reply Bookmark Topic Watch Topic
  • New Topic

Advice for a chat server solution  RSS feed

 
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am planning to develop a chat server based upon sockets. The requirement is to have a application on a web server which creates a server socket and accepts any requests from clients on that server socket. The question is, how can I open a server socket? Should I need to do it in a servlet? if yes, can a servlet handle 100-1000 simultaneous connection requests? if I am creating a thread per connection, isn't too much when it comes to 1000 threads?
thanks for your time and anticipate advices?
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just asking, you want to implement your own and not for example using something like openIM, an open java Jabber server?
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to stick with the building your own path. This should be a lot of fun and very educational as a personal project, but if you're trying to make it for work or for real users, follow Bart's path to something already built.

Anyhow, forget servlets. This will be much simpler than that! You can start a Plain Old Java Object from a main() and open a ServerSocket and then you're in business. The Sun Custom Networking Tutorial is quite good. Work your way through that, code and run the examples, and you'll learn a lot of what you need.

And for grins, here's part of a server I made. you should be able to explain what it does pretty well by the end of the tutorial.
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks a lot for the replies. I have done a entire chat application during my graduate years. But this time, it is not simple, I have to come up with a good reliable, fault tolerant architecture. I read the openIM but I still haven't decided about it. I was looking at the Apache MINA project. I haven't gone through it entirely but sounds promising. I just checked this project, cause I believe, having a reliable and well tested networking architecture is the most important aspect. Any ideas about the path I am currently following?

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