C# Класс 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
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
_conMessageQ ArrayList
_isDone bool
_minTimeoutSecs uint
_waitEvent AutoResetEvent

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
PollQ ( ) : void

The thread procedure that continues to poll the queue for timeout

Описание методов

AddToWaitQ() публичный Метод

Add message to wait queue
public AddToWaitQ ( AbstractCoAPMessage coapMsg ) : void
coapMsg AbstractCoAPMessage AbstractCoAPMessage
Результат void

GetInUseMessageIDs() публичный Метод

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
Результат ArrayList

GetRequestPendingResponse() публичный Метод

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
Результат CoAPRequest

PollQ() защищенный Метод

The thread procedure that continues to poll the queue for timeout
protected PollQ ( ) : void
Результат void

RemoveFromWaitQ() публичный Метод

Remove message from wait queue
public RemoveFromWaitQ ( UInt16 msgId ) : void
msgId UInt16 The message Id corresponding to the message that needs to be removed
Результат void

Shutdown() публичный Метод

Shutdown the polling
public Shutdown ( ) : void
Результат void

TimedQueue() публичный Метод

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
Результат System

Описание свойств

_conMessageQ защищенное свойство

Holds all the confirmable messages waiting for ACK or RST
protected ArrayList _conMessageQ
Результат ArrayList

_isDone защищенное свойство

For thread lifetime management
protected bool _isDone
Результат bool

_minTimeoutSecs защищенное свойство

The minimum timeout in seconds
protected uint _minTimeoutSecs
Результат uint

_waitEvent защищенное свойство

For thread synchronization
protected AutoResetEvent _waitEvent
Результат AutoResetEvent