Results 1 to 2 of 2

Thread: Idle functions possible?

  1. #1
    coke's Avatar
    coke is offline Registered User
    Join Date
    Jan 2005
    Location
    Rotterdam, Holland
    Posts
    7

    Question Idle functions possible?

    I am a bit puzzled by how Ice behaves when it is idle. For this particular problem I have also read a bit on ACM, but I am not sure if that is what I want it to do.

    I have a server in Ice, and several clients connecting to it. So far I understand that the connections are non-persistent, i.e. client connects, does a request, and then it disconnects. Correct me if I am wrong. The clients will be sending a heartbeat to the server every few seconds to tell the server it is still there. The server will then accept the heartbeat and keep track of the last heartbeat timestamp.

    Now, what I'd like to do, is for the server to periodically, say, in its idle time, check in its table of client connections if a client has not been heartbeating for a certain amount of seconds. When that threshold has been passed, the client is regarded as disconnected.

    I know there is a ConnectionIdleTime property in Ice, but I'm not sure what the impact is. 'Cause I want the server to take some action when a client disconnects, i.e. remove the client ID from the list of connected clients, and remove the pending messages for that client from the Messages database. I want to be able to do that kind of thing. Can anybody give me directions as to how to do this?

    Thanks in advance.
    coke

  2. #2
    mes's Avatar
    mes
    mes is offline ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi,

    Connections are managed transparently by Ice. A connection is established automatically the first time a client uses a proxy. If automatic connection management (ACM) is enabled, that connection is gracefully shutdown after it has been idle for a specified time, but it is not currently possible for an application to be notified when a connection is shutdown.

    It sounds like what you want is session management, however the lifetime of a session doesn't necessarily need to be bound to the lifetime of a connection. In other words, you should define session expiration and heartbeat intervals based on application requirements, not on the behavior of Ice's internal connection management. If you do enable ACM, it would obviously be beneficial to set the connection idle timeout to a value larger than the heartbeat interval, so that connections are not continually shutdown and reestablished.

    Session management is a subject that is raised repeatedly by Ice users, and we are planning to make it easier to incorporate into applications. Meanwhile, you should have a look at the source code for the Glacier2 router, which implements session management.

    Take care,
    - Mark

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Application Idle
    By susannesch in forum Help Center
    Replies: 20
    Last Post: 07-13-2009, 11:06 AM
  2. Static Functions
    By acbell in forum Help Center
    Replies: 5
    Last Post: 02-17-2005, 09:54 PM
  3. idle timeout and IceSSL
    By nsns in forum Bug Reports
    Replies: 7
    Last Post: 01-26-2005, 03:41 AM
  4. Need these functions:
    By motoyang in forum Comments
    Replies: 1
    Last Post: 11-23-2004, 03:24 PM
  5. Idle traffic
    By crj18 in forum Help Center
    Replies: 1
    Last Post: 10-11-2004, 05:45 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
  •