示例#1
0
 /// <summary>
 ///  The serialize init response.
 /// </summary>
 /// <param name="headerWriter">The header writer.</param>
 /// <returns> the init response</returns>
 internal static byte[] SerializeInitResponse(IRtsMessageHeaderConverter headerWriter)
 {
     using (ReusableMemoryStream stream = new ReusableMemoryStream())
     {
         stream.Position = headerWriter.HeaderSize;
         RtsInitResponseMessage.Serialize(stream);
         stream.Position = 0L;
         headerWriter.WriteHeader(stream, RtsMessageType.InitResponse, false);
         return(stream.ToArray());
     }
 }
示例#2
0
 /// <summary>
 /// The serialize init request.
 /// </summary>
 /// <param name="headerWriter">The header Writer.</param>
 /// <param name="protocolVersion">The protocol version</param>
 /// <param name="clientVersion">The client version.</param>
 /// <param name="applicationId">The application id.</param>
 /// <returns>the serialized init request</returns>
 internal static byte[] SerializeInitRequest(IRtsMessageHeaderConverter headerWriter, Version protocolVersion, Version clientVersion, string applicationId)
 {
     using (ReusableMemoryStream stream = new ReusableMemoryStream())
     {
         stream.Position = headerWriter.HeaderSize;
         new RtsInitMessage(new byte[] { (byte)protocolVersion.Major, (byte)protocolVersion.Minor }, new byte[] { (byte)clientVersion.Major, (byte)clientVersion.Minor, (byte)clientVersion.Build }, applicationId).Serialize(stream);
         stream.Position = 0L;
         headerWriter.WriteHeader(stream, RtsMessageType.Init, false);
         return(stream.ToArray());
     }
 }
示例#3
0
 // Methods
 protected GpBinaryByteProtocolV16Flash(ProtocolType protocolType, IRtsMessageHeaderConverter headerWriter)
     : base(protocolType, headerWriter)
 {
 }
示例#4
0
 /// <summary>
 ///  Initializes a new instance of the <see cref="T:Photon.SocketServer.Rpc.Protocols.Amf3.Amf3Protocol"/> class.
 /// </summary>
 /// <param name="protocolType">The protocol Type.</param>
 /// <param name="headerWriter">The header Provider.</param>
 private Amf3Protocol(ProtocolType protocolType, IRtsMessageHeaderConverter headerWriter)
 {
     this.protocolType = protocolType;
     this.headerWriter = headerWriter;
     this.headerSize   = headerWriter.HeaderSize;
 }
示例#5
0
 // Methods
 protected GpBinaryByteProtocolV16(ProtocolType protocolType, IRtsMessageHeaderConverter headerWriter)
 {
     this.protocolType = protocolType;
     this.headerWriter = headerWriter;
     this.headerSize   = headerWriter.HeaderSize;
 }