Class representing a control packet for the protocol defined and implement by the UdpMediaClientSocket. This packet consist of a packet type identifier, sender GUID, a Int64 sequence number, target GUID and a command.
More...
Inherits INetworkPacket.
|
enum | CommandType : byte { RequestEnableRouting,
RequestDisableRouting,
Statistics
} |
|
|
| ControlPacket () |
| Initializes a new ControlPacket instance with no parameters. More...
|
|
| ControlPacket (string sourceGuid, string targetGuid, CommandType command, byte[] payload, Int64 sequenceNumber) |
| Initializes a new ControlPacket instance that has the specified source and target Guids, command, payload data and sequence number. More...
|
|
| ControlPacket (string sourceGuid, string targetGuid, CommandType command, Int64 sequenceNumber) |
| Initializes a new ControlPacket instance that has the specified source and target Guids, command and sequence number. More...
|
|
| ControlPacket (string sourceGuid, string targetGuid, CommandType command, byte[] payload) |
| Initializes a new ControlPacket instance that has the specified source and target Guids, command and payload data. More...
|
|
| ControlPacket (string sourceGuid, string targetGuid, CommandType command) |
| Initializes a new ControlPacket instance that has the specified source and target Guids and command. More...
|
|
| ControlPacket (byte[] sourceGuid, byte[] targetGuid, CommandType command, byte[] payload) |
| Initializes a new ControlPacket instance that has the specified source and target Guids, command and payload data. More...
|
|
void | FromBytes (byte[] packetBytes) |
| Sets the state of this packet from the provided array of bytes. If the array does not containt a valid byte representation of this type of packet, throws an ArgumentException. More...
|
|
byte[] | GetBytes (long sequenceNumber) |
|
byte[] | GetBytes () |
| Converts this packet to a byte array for network transfer. The sequence number specified in the packet will be used. More...
|
|
byte[] | GetBytes (Int64 sequence) |
| Converts this packet to a byte array for network transfer. The specified seqeuence number will be used in the packet header. More...
|
|
|
const byte | PacketId = 2 |
|
const int | HeaderLengthInOctets = 42 |
|
Class representing a control packet for the protocol defined and implement by the UdpMediaClientSocket. This packet consist of a packet type identifier, sender GUID, a Int64 sequence number, target GUID and a command.
<author>Veli-Mikko Puupponen</author> Control packets are primarily user to request server packet routing from one client to another.
This packet can have optional payload data.
ControlPacket |
( |
string |
sourceGuid, |
|
|
string |
targetGuid, |
|
|
CommandType |
command, |
|
|
byte[] |
payload, |
|
|
Int64 |
sequenceNumber |
|
) |
| |
Initializes a new ControlPacket instance that has the specified source and target Guids, command, payload data and sequence number.
Throws an ArgumentException if source or target Guid is malformed.
- Parameters
-
sourceGuid | String representation of the sender's Guid |
sourceGuid | String representation of the target's Guid |
command | Packet command |
payload | Optional payload data |
sequenceNumber | Packet sequence number |
ControlPacket |
( |
string |
sourceGuid, |
|
|
string |
targetGuid, |
|
|
CommandType |
command, |
|
|
Int64 |
sequenceNumber |
|
) |
| |
Initializes a new ControlPacket instance that has the specified source and target Guids, command and sequence number.
Throws an ArgumentException if source or target Guid is malformed.
- Parameters
-
sourceGuid | String representation of the sender's Guid |
sourceGuid | String representation of the target's Guid |
command | Packet command |
sequenceNumber | Packet sequence number |
ControlPacket |
( |
string |
sourceGuid, |
|
|
string |
targetGuid, |
|
|
CommandType |
command, |
|
|
byte[] |
payload |
|
) |
| |
Initializes a new ControlPacket instance that has the specified source and target Guids, command and payload data.
Throws an ArgumentException if source or target Guid is malformed.
- Parameters
-
sourceGuid | String representation of the sender's Guid |
sourceGuid | String representation of the target's Guid |
command | Packet command |
payload | Optional payload data |
ControlPacket |
( |
string |
sourceGuid, |
|
|
string |
targetGuid, |
|
|
CommandType |
command |
|
) |
| |
Initializes a new ControlPacket instance that has the specified source and target Guids and command.
Throws an ArgumentException if source or target Guid is malformed.
- Parameters
-
sourceGuid | String representation of the sender's Guid |
sourceGuid | String representation of the target's Guid |
command | Packet command |
ControlPacket |
( |
byte[] |
sourceGuid, |
|
|
byte[] |
targetGuid, |
|
|
CommandType |
command, |
|
|
byte[] |
payload |
|
) |
| |
Initializes a new ControlPacket instance that has the specified source and target Guids, command and payload data.
Throws an ArgumentException if any of the arguments is null.
- Parameters
-
sourceGuid | Byte representation of the sender's Guid |
sourceGuid | Byte representation of the target's Guid |
command | Packet command |
payload | Optional payload data |
void FromBytes |
( |
byte[] |
packetBytes | ) |
|
Sets the state of this packet from the provided array of bytes. If the array does not containt a valid byte representation of this type of packet, throws an ArgumentException.
Throws an ArgumentException if the provided array does not containt a valid byte repsentation of the packet type.
- Parameters
-
packetBytes | Byte representation of a packet with the same type as this packet |
Implements INetworkPacket.
Converts this packet to a byte array for network transfer. The sequence number specified in the packet will be used.
Throws an ArgumentException if the packet is not in a properly initializes state.
- Returns
- A byte array containing data and transfer header for this packet
Implements INetworkPacket.
Packet payload data. Can be null.
String represenstation of the Guid identifying the sender
String represenstation of the Guid identifying the target
The documentation for this class was generated from the following file: