singrdk/base/Services/NetStack/Runtime/TimeOut.cs

58 lines
1.5 KiB
C#
Raw Permalink Normal View History

2008-11-17 18:29:00 -05:00
// ----------------------------------------------------------------------------
2008-03-05 09:52:00 -05:00
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
2008-11-17 18:29:00 -05:00
// ----------------------------------------------------------------------------
2008-03-05 09:52:00 -05:00
2008-11-17 18:29:00 -05:00
///
// Microsoft Research, Cambridge
//
2008-03-05 09:52:00 -05:00
namespace NetStack
{
namespace Runtime
{
// A timeout context declaration.
// A module creates a context for a timeout event
// and pass it to the runtime upon request.
public class TimeOutContext
{
// the timeout value
protected uint timeValue;
// the timeout handler
protected TimeOutHandler handler;
// module specific context
protected object context;
// the handler declaration
public delegate NetStatus TimeOutHandler();
// ctor
public TimeOutContext(uint time,TimeOutHandler tHandler,object ctx)
{
timeValue=time;
handler=tHandler;
context=ctx;
}
// properties
public TimeOutHandler Handler
{
get {return handler;} set {handler=value;}
}
public uint TimeOutValue
{
get {return timeValue;} set {timeValue=value;}
}
public object Context
{
get {return context;} set {context=value;}
}
}
}
}