Stormancer.Core.Packet< T > Class Template Reference

A packet sent by a remote peer to the running peer. More...

Public Member Functions

 Packet (T source, Stream stream)
 
 Packet (T source, Stream stream, Dictionary< string, object > metadata)
 
TData GetMetadata< TData > (string key)
 Reads and return metadata casted to the requested type. More...
 
 Packet (IConnection source, Stream stream)
 

Properties

Stream Stream [get]
 Data contained in the packet. More...
 
Dictionary< string, object > Metadata [get]
 Metadata stored by the packet. More...
 
Connection [get, set]
 The remote peer that sent the packet. More...
 

Detailed Description

A packet sent by a remote peer to the running peer.

Member Function Documentation

◆ GetMetadata< TData >()

TData Stormancer.Core.Packet< T >.GetMetadata< TData > ( string  key)

Reads and return metadata casted to the requested type.

Template Parameters
TThe returned metadata type.
Parameters
keyA string containing a metadata key.
Returns
The metadata for the key as a T

Property Documentation

◆ Connection

T Stormancer.Core.Packet< T >.Connection
getset

The remote peer that sent the packet.

◆ Metadata

Dictionary<string, object> Stormancer.Core.Packet< T >.Metadata
get

Metadata stored by the packet.

◆ Stream

Stream Stormancer.Core.Packet< T >.Stream
get

Data contained in the packet.


The documentation for this class was generated from the following file:
  • Stormancer.Core/Packet.cs