Results 1 to 3 of 3

Thread: Connection loss detection on server side

  1. #1
    Dima_Sun is offline Registered User
    Name: Dmitry Kazakov
    Organization: SC "Atlas"
    Project: Distributed Intrusion Detection System development
    Join Date
    Nov 2008
    Posts
    4

    Connection loss detection on server side

    Hello, ZeroC support team.

    I have two ICE components: the one is server component and the other is client one. The client connects to server, everything is fine.
    Server must manage the client component. So the client component embeds the callback on his side.
    Server can manage the client component by means of the callback, it works fine. Now the task is, server must know somehow whether the client is currently connected to it and it can manage the client or not. This task is solved in the following way. When server establishes a connection with a new client, it registers this connection together with client's callback in the map. Then another server's thread will ping each connection from the map and if the ping fail, then this means that the client is disconnected and there is no opportunity to manage it, so this map entry is deleted. I suppose my logic appears to be too complex, is there an easier way on the server's side detect the fact the one of his clients disconnected?

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    I recommend to take a look at Michi's "Gream Reaper" article in the issue #3 of the Connections newsletter here. This is a well-known pattern in distributed programming.

    One issue with your solution is that the server might have to ping a large number of clients if many clients are connected. And if some clients are unreachable, the ping calls might hang for a long time (unless you use AMI).

    Rather than have the server ping all the clients (which could be expensive for the server), it might be better to have the client ping the server. See the demo/Ice/session included with your Ice distribution for an example.

    Cheers,
    Benoit.

  3. #3
    Dima_Sun is offline Registered User
    Name: Dmitry Kazakov
    Organization: SC "Atlas"
    Project: Distributed Intrusion Detection System development
    Join Date
    Nov 2008
    Posts
    4
    Hello, Benoit.

    Thank you for your help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 11-20-2008, 04:52 AM
  2. Client side invocations from a Server app.
    By vincei in forum Comments
    Replies: 3
    Last Post: 07-04-2007, 09:27 AM
  3. how can i get peer ip_address in server side?
    By socketref in forum Help Center
    Replies: 1
    Last Post: 05-12-2006, 02:06 PM
  4. Question regarding IceBox / server side
    By ctennis in forum Help Center
    Replies: 5
    Last Post: 03-08-2006, 09:27 AM
  5. Server-side throughput performance measures?
    By SteveWampler in forum Help Center
    Replies: 3
    Last Post: 08-31-2004, 06:53 PM

Posting Permissions

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