Documentation ¶
Index ¶
Constants ¶
View Source
const ( NilType = 42 DictionaryType = 68 StringSliceType = 97 Int8Type = 98 Custom = 99 DoubleType = 100 EventDateType = 101 Float32Type = 102 Hashtable = 104 Int32Type = 105 Int16Type = 107 Int64Type = 108 Int32SliceType = 110 BooleanType = 111 OperationResponseType = 112 OperationRequestType = 113 StringType = 115 Int8SliceType = 120 SliceType = 121 ObjectSliceType = 122 )
View Source
const ( // Command types AcknowledgeType = 1 ConnectType = 2 VerifyConnectType = 3 DisconnectType = 4 PingType = 5 SendReliableType = 6 SendUnreliableType = 7 SendReliableFragmentType = 8 // Message types OperationRequest = 2 EventDataType = 4 OperationResponse = 7 )
View Source
const (
PhotonCommandHeaderLength = 12
)
Variables ¶
View Source
var PhotonLayerType = gopacket.RegisterLayerType(5056, gopacket.LayerTypeMetadata{ Name: "PhotonLayerType", Decoder: gopacket.DecodeFunc(decodePhotonPacket)})
Functions ¶
This section is empty.
Types ¶
type FragmentBuffer ¶
type FragmentBuffer struct {
// contains filtered or unexported fields
}
Provides a LRU backed buffer which will assemble ReliableFragments into a single PhotonCommand with type ReliableMessage
func NewFragmentBuffer ¶
func NewFragmentBuffer() *FragmentBuffer
Makes a new instance of a FragmentBuffer
func (*FragmentBuffer) Offer ¶
func (buf *FragmentBuffer) Offer(msg ReliableFragment) *PhotonCommand
Offers a message to the buffer. Returns nil when no new commands could be assembled from the buffer's contents.
type PhotonCommand ¶
type PhotonCommand struct { // Header Type uint8 ChannelID uint8 Flags uint8 ReservedByte uint8 Length int32 ReliableSequenceNumber int32 // Body Data []byte }
func (PhotonCommand) ReliableFragment ¶
func (c PhotonCommand) ReliableFragment() (msg ReliableFragment, err error)
Returns a structure containing the fields of a reliable fragment Errors if the type is not SendReliableFragmentType.
func (PhotonCommand) ReliableMessage ¶
func (c PhotonCommand) ReliableMessage() (msg ReliableMessage, err error)
Returns a structure containing the fields of a reliable message. Errors if the type is not SendReliableType.
type PhotonLayer ¶
type PhotonLayer struct { // Header PeerID uint16 CrcEnabled uint8 CommandCount uint8 Timestamp uint32 Challenge int32 // Commands Commands []PhotonCommand // contains filtered or unexported fields }
func (PhotonLayer) LayerContents ¶
func (p PhotonLayer) LayerContents() []byte
func (PhotonLayer) LayerPayload ¶
func (p PhotonLayer) LayerPayload() []byte
func (PhotonLayer) LayerType ¶
func (p PhotonLayer) LayerType() gopacket.LayerType
type ReliableFragment ¶
type ReliableMessage ¶
type ReliableMessageParamaters ¶
type ReliableMessageParamaters map[uint8]interface{}
func DecodeReliableMessage ¶
func DecodeReliableMessage(msg ReliableMessage) ReliableMessageParamaters
Converts the parameters of a reliable message into a hash suitable for use in hashmap.
Click to show internal directories.
Click to hide internal directories.