Photon Server API Documentation v5.0RC1

Static Public Member Functions | Static Public Attributes | Properties | List of all members
Photon.SocketServer.Protocol Class Reference

This class provides access to the available protocols. More...

Static Public Member Functions

static bool TryRegisterCustomType (Type customType, byte typeCode, Func< object, byte[]> serializeFunction, Func< byte[], object > deserializeFunction)
 Tries to register a custom type for serialization. More...
 
static void RegisterTypeMapper (IUnknownTypeMapper mapper)
 
static bool TryParseInitRequest (byte[] data, out InitRequest initRequest)
 The try parse init request. More...
 

Static Public Attributes

const int CRYPTO_BLOCK_SIZE = 16
 

Properties

static bool AllowRawCustomValues [get, set]
 Gets or sets a value indicating whether unknown customes types are allowed. if set to true unknown custom types will be serialized as an RawCustomValue instance. More...
 
static Dictionary< ProtocolType, IRpcProtocolProtocols [get]
 
static IRpcProtocol GpBinaryV162 [get]
 Gets the GpBinary protocol version 1.6 with header version 2 More...
 
static IRpcProtocol GpBinaryV17 [get]
 Gets the GpBinary protocol version 1.7 More...
 
static IRpcProtocol Json [get]
 Gets the Json protocol implementation. More...
 
static IRpcProtocol GpBinaryV18 [get]
 
static Dictionary< ProtocolType, IRpcProtocolAllProtocols [get]
 
static InboundController InboundController = new InboundController() [get, set]
 
static Encoding IncomingDataEncoding = Encoding.GetEncoding("UTF-8", EncoderFallback.ExceptionFallback, new DecoderReplacementFallback("?")) [get]
 

Detailed Description

This class provides access to the available protocols.

Member Function Documentation

◆ RegisterTypeMapper()

static void Photon.SocketServer.Protocol.RegisterTypeMapper ( IUnknownTypeMapper  mapper)
inlinestatic

◆ TryParseInitRequest()

static bool Photon.SocketServer.Protocol.TryParseInitRequest ( byte[]  data,
out InitRequest  initRequest 
)
inlinestatic

The try parse init request.

Parameters
dataThe data.
initRequestThe init request.
Returns
True if init request had correct format.

◆ TryRegisterCustomType()

static bool Photon.SocketServer.Protocol.TryRegisterCustomType ( Type  customType,
byte  typeCode,
Func< object, byte[]>  serializeFunction,
Func< byte[], object >  deserializeFunction 
)
inlinestatic

Tries to register a custom type for serialization.

Parameters
customTypeType of the custom type.
typeCodeThe type code.
serializeFunctionThe serialize function.
deserializeFunctionThe deserialize function.
Returns
True if the custom type was successfully registered; otherwise false. False will be returned if either the type or the type code already is registered.

Member Data Documentation

◆ CRYPTO_BLOCK_SIZE

const int Photon.SocketServer.Protocol.CRYPTO_BLOCK_SIZE = 16
static

Property Documentation

◆ AllowRawCustomValues

bool Photon.SocketServer.Protocol.AllowRawCustomValues
staticgetset

Gets or sets a value indicating whether unknown customes types are allowed. if set to true unknown custom types will be serialized as an RawCustomValue instance.

true if unknown custom types are allowed; otherwise, false.

◆ AllProtocols

Dictionary<ProtocolType, IRpcProtocol> Photon.SocketServer.Protocol.AllProtocols
staticget
Initial value:
= new Dictionary<ProtocolType, IRpcProtocol>()
{
{ ProtocolType.GpBinaryV16, GpBinaryV162 },
{ ProtocolType.GpBinaryV17, GpBinaryV17 },
{ ProtocolType.GpBinaryV18, GpBinaryV18 },
{ ProtocolType.Json, Json}
}

◆ GpBinaryV162

IRpcProtocol Photon.SocketServer.Protocol.GpBinaryV162
staticget

Gets the GpBinary protocol version 1.6 with header version 2

◆ GpBinaryV17

IRpcProtocol Photon.SocketServer.Protocol.GpBinaryV17
staticget

Gets the GpBinary protocol version 1.7

◆ GpBinaryV18

IRpcProtocol Photon.SocketServer.Protocol.GpBinaryV18
staticget

◆ InboundController

InboundController Photon.SocketServer.Protocol.InboundController = new InboundController()
staticgetset

◆ IncomingDataEncoding

Encoding Photon.SocketServer.Protocol.IncomingDataEncoding = Encoding.GetEncoding("UTF-8", EncoderFallback.ExceptionFallback, new DecoderReplacementFallback("?"))
staticget

◆ Json

IRpcProtocol Photon.SocketServer.Protocol.Json
staticget

Gets the Json protocol implementation.

◆ Protocols

Dictionary<ProtocolType, IRpcProtocol> Photon.SocketServer.Protocol.Protocols
staticget
Photon.SocketServer.Protocol.GpBinaryV162
static IRpcProtocol GpBinaryV162
Gets the GpBinary protocol version 1.6 with header version 2
Definition: Protocol.cs:122
Photon.SocketServer.Protocol.Json
static IRpcProtocol Json
Gets the Json protocol implementation.
Definition: Protocol.cs:144
Photon.SocketServer.Protocol.GpBinaryV18
static IRpcProtocol GpBinaryV18
Definition: Protocol.cs:163
Photon.SocketServer.Protocol.GpBinaryV17
static IRpcProtocol GpBinaryV17
Gets the GpBinary protocol version 1.7
Definition: Protocol.cs:133