• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Advice for a chat server solution

 
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
We don't have time for this. We've gotta save the moon! Or check this out:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic