Creates a copy of the packet.

Namespace: RRAutoLib.Loconet
Assembly: RRAutoLib (in RRAutoLib.dll) Version: 1.4.4504.18867

Syntax

C#
public virtual Object Clone()
Visual Basic
Public Overridable Function Clone As Object

Return Value

A Packet object that has the same data content as the cloned packet.

Implements

ICloneable..::..Clone()()()()

Remarks

The following methods are not cloned but initialized instead: A packet should not be altered in any way after its transmission since the Loconet service will proccess it at an indeterminant time on another thread. If you must send the same packet repeatedly, send a clone of it instead to insure packet uniqueness and immutability.

Examples

The following example shows the correct way of transmitting a packet repeatedly:
CopyVB.NET
'assumes objLoconetService has been previously initialized and started
Dim objPacket As New PkReqSlotData(3)
objLoconetService.TxPacket(objPacket.Clone)
objPacket.Slot = 4
objLoconetService.TxPacket(objPacket.Clone)
objPacket.Slot = 5
objLoconetService.TxPacket(objPacket)

See Also