This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Socket connection performance

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

While writing one simple chat application i got one doubt .
Suppose ,if i am chatting with single person ,i will establish socket connection with that client and send message to that client to particular port.Once i finsh chat i will close socket connection.

Now if i want to chat with more people say 100 people(just an example) at a time .then is it good to create 100 different socket connection?

Where as in database we normally use Connection pool,so i can reuse already created object.Do we have same think in socket connection?

I have a doubt because in database we are connection to one single databae ,so i can reuse already created one.But for doing chat i may have to connect to different IP address and port .

If number of clent increase socket connection also increases ..so i think there will be performance drawback in this application.Can any one of you tell me how to overcome this problem
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends on your clients. If they don't know anything about sockets, then how could you "connect" to them?

If they are socket-driven, have them connect to a socket server, and include support for multi-casting in your server software.
 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hung,

... and include support for multi-casting in your server software.



Can you please elaborate this ...i didn't got what you said
 
Bartender
Posts: 9625
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at this article on multicasting. Multicasting has its own set of disadvantages, so there are tradeoffs made when using it.
reply
    Bookmark Topic Watch Topic
  • New Topic