timers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Norvin Laudon

    #1

    timers

    Hi,

    Some basic advice needed for a C# semi-newbie:

    I have a server program that exposes a Singleton object (lets call it
    "ServerObje ct") to a number of clients, using Remoting.

    Clients call a method of ServerObject, which returns an object (call it
    "ObjectToProces s") to the client. Upon receiving this ObjectToProcess , the
    client performs some analysis (actually performed by a human), and sometime
    later the ObjectToProcess is returned to the ServerObject.
    A client can hold more than one ObjectToProcess at a time (that is, a client
    can ask for a second object before returning the first).

    So far, I have the above communication working.

    My goal: I would like to start a timeout timer on the server for each object
    that is doled out to the client. If the timer times out (i.e. the client has
    not returned the processed object in the allowable time), the server should
    sever communications with the client.
    When the timer times out, I would also like to know which object and which
    client timed out.

    1. How do I start a unique timer for each ObjectToProcess that is sent to
    clients, and wire up an event for the timeout? (Each ObjectToProcess has a
    unique name, number, etc.)

    2. When a timer times out and fires its timeout event, how can I keep track
    of which object and client were originally associated with this timer?

    3. <Optional Remoting question> How can I sever communications with the
    client such that the next time the client tries to access the server object,
    an exception is thrown on the client?

    TIA,
    Norvin



Working...