Utility methods to manage IProtocolToken's content
More...
Utility methods to manage IProtocolToken's content
◆ GetToken< T >()
static T Photon.Bolt.ProtocolTokenUtils.GetToken< T > |
( |
| ) |
|
|
inlinestatic |
Creates a new Protocol Token instance from a PooledProtocolToken type that can be reused by the pooling system
- Template Parameters
-
- Returns
- A new instance of a PooledProtocolToken
- Type Constraints
-
T | : | PooledProtocolTokenBase | |
◆ ReadToken()
Reads a IProtocolToken from the UdpPacket
- Parameters
-
packet | Packet from where the Token will be read |
- Returns
- IProtocolToken read from the tip of the Packet
◆ SerializeToken()
Handle Read and Write of a IProtocolToken based on the UdpPacket type, if UdpKit.UdpPacket.Write is true, this method will write the Token, or read it otherwise.
- Parameters
-
packet | UdpPacket where the Token will be manupulated |
token | IProtocolToken to be written or read |
◆ ToByteArray()
static byte [] Photon.Bolt.ProtocolTokenUtils.ToByteArray |
( |
this IProtocolToken |
token | ) |
|
|
inlinestatic |
Convert the IProtocolToken into a byte array
- Parameters
-
token | Token to be converted |
- Returns
- Byte array with the Token content
◆ ToToken()
static IProtocolToken Photon.Bolt.ProtocolTokenUtils.ToToken |
( |
this byte[] |
bytes | ) |
|
|
inlinestatic |
Convert a byte array into a IProtocolToken
- Parameters
-
bytes | Byte array to be converted |
- Returns
- IProtocolToken of type described on the byte array
◆ WriteToken()
Writes a IProtocolToken into this UdpPacket
- Parameters
-
packet | Packet where the Token will be written |
token | IProtocolToken to be written at the end of the Packet |