Results 1 to 9 of 9
  1. #1
    k1ng is offline Member
    Join Date
    Apr 2012
    Posts
    59
    Rep Power
    0

    Default Multple Instances of a server using the same connection count?

    I have a server application, I'm trying to think of a way in which many instances of the server can count their number of connections so that they can all be set to the same limit. I can think of 2 way to do this but not how to implement them, I need some ideas...

    - by having a server check if an instance of itself is already running on startup and setup some kind of communication between them

    I'm not sure if Java can even do this, I've never came across any functionality that can do this cross platform.

    - by having a standard entry point which starts the server and keeps track of connections

    Again, not entirely sure how this would be done :/

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: Multple Instances of a server using the same connection count?

    check if an instance of itself is already running
    Use a Socket to test If the port is in use
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    k1ng is offline Member
    Join Date
    Apr 2012
    Posts
    59
    Rep Power
    0

    Default Re: Multple Instances of a server using the same connection count?

    That can't really tell me how many clients are connected though. :(

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: Multple Instances of a server using the same connection count?

    You would have to ask the server that question.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    k1ng is offline Member
    Join Date
    Apr 2012
    Posts
    59
    Rep Power
    0

    Default Re: Multple Instances of a server using the same connection count?

    That's my problem, the server can be started more than once and I need to keep track of all connected clients between them

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: Multple Instances of a server using the same connection count?

    server can be started more than once
    How does the server keep its clients when it restarted?
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    k1ng is offline Member
    Join Date
    Apr 2012
    Posts
    59
    Rep Power
    0

    Default Re: Multple Instances of a server using the same connection count?

    It isn't REstarted, just started more than once. The program can be run, then run again so two instances are running and neither are aware of how many connections the other is using.

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default Re: Multple Instances of a server using the same connection count?

    How do the servers handle port conflicts? How do they chose which ports to listen to?
    If you don't understand my response, don't ignore it, ask a question.

  9. #9
    k1ng is offline Member
    Join Date
    Apr 2012
    Posts
    59
    Rep Power
    0

    Default Re: Multple Instances of a server using the same connection count?

    Ah good point, I've overlooked something obvious here. It's quite a large codebase and it hadn't occured to me that different servers would need to use different ports, lol. Thanks

Similar Threads

  1. Replies: 2
    Last Post: 10-16-2011, 04:42 AM
  2. sql server connection problem
    By m.ali in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-22-2010, 06:09 PM
  3. Replies: 1
    Last Post: 02-09-2009, 03:40 PM
  4. Connection the sql server
    By Preethi in forum New To Java
    Replies: 7
    Last Post: 06-26-2008, 03:05 PM
  5. Multple Clients
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 06:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •