Esempio n. 1
0
 public DisconnectMessage(Protocol.ReasonCode code, string message)
 {
     this.message        = new Protocol.DisconnectMessage();
     this.message.Reason = code;
     this.type           = (byte)MessageTypes.MsgType.P2P_DISCONNECT;
     this.data           = this.message.ToByteArray();
     this.reason_message = message;
 }
Esempio n. 2
0
 public DisconnectMessage(byte type, byte[] raw_data)
     : base(type, raw_data)
 {
     try
     {
         this.message = Protocol.DisconnectMessage.Parser.ParseFrom(raw_data);
     }
     catch (System.Exception e)
     {
         Logger.Error(e.Message);
     }
 }