Click or drag to resize

LoconetServiceTxPriorityPacket Method

Transmits a packet asynchronously with high priority.

Namespace:  RRAutoLib.Loconet
Assembly:  RRAutoLib (in RRAutoLib.dll) Version: 4.0.8678.28884
Syntax
Public Function TxPriorityPacket ( 
	objPacket As Packet,
	Optional sctCancelToken As CancellationToken = Nothing
) As Task(Of Boolean)

Parameters

objPacket
Type: RRAutoLib.LoconetPacket
The Packet to be transmited.
sctCancelToken (Optional)
Type: System.ThreadingCancellationToken
Token provided by a controlling source to notify this method that it should cancel its execution.

Return Value

Type: TaskBoolean
The awaitable Task returning True if the packet echoed back from the Loconet interface, indicating a successfull send. False could be returned if the service is stopped or the interface did not respond in a timely fashion.
Remarks
The Loconet service has two transmition queues; a normal queue accessed by TxPacket(Packet, CancellationToken) and a priority queue accessed by TxPriorityPacket. Packets placed in the priority queue will jump in line to be transmited ahead of packets placed in the normal queue. For example, TxPriorityPacket is better suited for locomotive control where responsiveness is more important. Response packets are returned through the sending packet's RxPacket property for those that expect them.
See Also