Active connection tracking

piccininipiccinini Enrico PiccininiOrganization: EgiconProject: RoboticsMember
Hi,

I'm sorry for the very basic question.

I need to limit (simple ice application) the number of client actually connected to the server. The purpose of this, is to limit the number of client simultaneously connected to the server to save ethernet band.

Is there a preference to do this ? (for example max thread pool....)

How log a tcp/ip connection last in ICE? Only for a single rpc or for all lifecycle of client communicator?

Thanks a lot in advance

Enrico

Comments

  • benoitbenoit Rennes, FranceBenoit FoucherOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi Enrico,

    Ice doesn't provide hooks to allow monitoring connections (see this FAQ). The best way to achieve what you want is to use a session mechanism. Clients create a session with the server when they need to use the server and destroy the session when they are done. This way you can easily control the maximum number of sessions by rejecting clients at session creation. Sessions also allow you to reliably keep track of active clients thanks to the heartbeat and will make allow to easily cleanup client resources.

    Issue #3 of the Ice connections newletter discuss the session design pattern: see here. The chat demo hosted on our website also demonstrates the use of sessions. For examples, see the demo in the demo/Ice/session directory of your Ice distribution.

    Finally, you might want to consider using Glacier2 if your clients also need to connect to your server through a firewall. Glacier2 makes firewall traversal easier and also uses a session mechanism for keeping track of the connected clients. See the Glacier2 demos in your Ice distributions for some examples.

    Cheers,
    Benoit.
  • piccininipiccinini Enrico PiccininiOrganization: EgiconProject: RoboticsMember
    Thank you a lot. :)

    benoit wrote: »
    Hi Enrico,

    Ice doesn't provide hooks to allow monitoring connections (see this FAQ). The best way to achieve what you want is to use a session mechanism. Clients create a session with the server when they need to use the server and destroy the session when they are done. This way you can easily control the maximum number of sessions by rejecting clients at session creation. Sessions also allow you to reliably keep track of active clients thanks to the heartbeat and will make allow to easily cleanup client resources.

    Issue #3 of the Ice connections newletter discuss the session design pattern: see here. The chat demo hosted on our website also demonstrates the use of sessions. For examples, see the demo in the demo/Ice/session directory of your Ice distribution.

    Finally, you might want to consider using Glacier2 if your clients also need to connect to your server through a firewall. Glacier2 makes firewall traversal easier and also uses a session mechanism for keeping track of the connected clients. See the Glacier2 demos in your Ice distributions for some examples.

    Cheers,
    Benoit.
Sign In or Register to comment.