Example #1
0
 /// <summary>
 /// Sends message to login server.
 /// </summary>
 public async Task Send(ISMessage mesage)
 {
     await _connection.SendAsync(ISHub.MessageTypeToMethodName[mesage.Type], mesage.Payload);
 }
 internal IBroadcastMessage CreateSETMessage(string message)
 {
     IBroadcastMessage result;
     try
     {
         string text = message.Substring(0, 2);
         switch (text)
         {
         case "TP":
             result = new TPMessage(message);
             return result;
         case "L+":
             result = new LSAccumulate(message);
             return result;
         case "PO":
             result = new POMessage(message);
             return result;
         case "B+":
             result = new BCTextMessage(message);
             return result;
         case "IS":
             result = new ISMessage(message);
             return result;
         case "IE":
             result = new IEMessage(message);
             return result;
         case "LO":
             this.loMessage.Unpack(message);
             result = this.loMessage;
             return result;
         case "MT":
             result = new MarketInfo(message);
             return result;
         case "PD":
             this.pdMessage.Unpack(message);
             result = this.pdMessage;
             return result;
         case "SC":
             this.scMessage.Unpack(message);
             result = this.scMessage;
             return result;
         case "SS":
             result = new SSMessage(message);
             return result;
         case "AA":
             this.aaMessage.Unpack(message);
             result = this.aaMessage;
             return result;
         case "NH":
             this.nhMessage.Unpack(message);
             result = this.nhMessage;
             return result;
         case "BA":
             result = new BAMessage(message);
             return result;
         case "0I":
             result = new OrderInfoClient(message);
             return result;
         case "0B":
             this.broadcastMessageClient.Unpack(message);
             result = this.broadcastMessageClient;
             return result;
         case "0G":
             this.dgwOrderReply.Unpack(message);
             result = this.dgwOrderReply;
             return result;
         }
         result = null;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }