C# Class EXILANT.Labs.CoAP.Channels.TimedQueue

In CoAP, confirmable messages must wait for an ACK or RST. As long as we do not receive ACK or RST we continue to send the confirmable message, provided, we have not exhausted the maximum number of retries. This queue maintains a list of confirmable messages that are waiting for ACK or RST If we do not receive the response within the timeout, this queue raises a timed-out event
Afficher le fichier Open project: silverspringnetworks/developer_program

Protected Properties

Свойство Type Description
_conMessageQ ArrayList
_isDone bool
_minTimeoutSecs uint
_waitEvent AutoResetEvent

Méthodes publiques

Méthode Description
AddToWaitQ ( AbstractCoAPMessage coapMsg ) : void

Add message to wait queue

GetInUseMessageIDs ( ) : ArrayList

Each CON/NON message is associated with a message ID. CON messages cannot be discarded unless ACK/RST is received or delivery attempt fails. This method tells us which message IDs are associated with pending CON messages

GetRequestPendingResponse ( UInt16 msgId ) : CoAPRequest

Get the request message that was pending response

RemoveFromWaitQ ( UInt16 msgId ) : void

Remove message from wait queue

Shutdown ( ) : void

Shutdown the polling

TimedQueue ( uint minTimeoutSecs ) : System

We start a thread here that keeps polling the confirmable messages It checks if the message timed-out, and if yes, raises the timeout event

Méthodes protégées

Méthode Description
PollQ ( ) : void

The thread procedure that continues to poll the queue for timeout

Method Details

AddToWaitQ() public méthode

Add message to wait queue
public AddToWaitQ ( AbstractCoAPMessage coapMsg ) : void
coapMsg AbstractCoAPMessage AbstractCoAPMessage
Résultat void

GetInUseMessageIDs() public méthode

Each CON/NON message is associated with a message ID. CON messages cannot be discarded unless ACK/RST is received or delivery attempt fails. This method tells us which message IDs are associated with pending CON messages
public GetInUseMessageIDs ( ) : ArrayList
Résultat ArrayList

GetRequestPendingResponse() public méthode

Get the request message that was pending response
public GetRequestPendingResponse ( UInt16 msgId ) : CoAPRequest
msgId UInt16 The message Id corresponding to the message that needs to be extracted
Résultat CoAPRequest

PollQ() protected méthode

The thread procedure that continues to poll the queue for timeout
protected PollQ ( ) : void
Résultat void

RemoveFromWaitQ() public méthode

Remove message from wait queue
public RemoveFromWaitQ ( UInt16 msgId ) : void
msgId UInt16 The message Id corresponding to the message that needs to be removed
Résultat void

Shutdown() public méthode

Shutdown the polling
public Shutdown ( ) : void
Résultat void

TimedQueue() public méthode

We start a thread here that keeps polling the confirmable messages It checks if the message timed-out, and if yes, raises the timeout event
public TimedQueue ( uint minTimeoutSecs ) : System
minTimeoutSecs uint What is the minimum timeout in seconds
Résultat System

Property Details

_conMessageQ protected_oe property

Holds all the confirmable messages waiting for ACK or RST
protected ArrayList _conMessageQ
Résultat ArrayList

_isDone protected_oe property

For thread lifetime management
protected bool _isDone
Résultat bool

_minTimeoutSecs protected_oe property

The minimum timeout in seconds
protected uint _minTimeoutSecs
Résultat uint

_waitEvent protected_oe property

For thread synchronization
protected AutoResetEvent _waitEvent
Résultat AutoResetEvent