Guest User

Untitled

a guest
Nov 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.02 KB | None | 0 0
  1.    virtual public void TransmitMessage(string inputmsg,out string outputmsg)
  2.         {
  3.             Utils.m_appLogger.Info("DEV-596 - Inside TransmitMessage");
  4.             Utils.m_appLogger.Info(string.Format("DEV-596 - inputmsg={0}", inputmsg));
  5.             outputmsg = string.Empty;
  6.  
  7.             for (int i = 0; i < 3; i++)
  8.             {
  9.                 try
  10.                 {
  11.                     Utils.m_appLogger.Info(string.Format("DEV-596 - Calling ConnectToServer, Attempt#:{0}", i));
  12.                     bool bSuccess = connectToServer();
  13.                     if (!bSuccess)
  14.                     {
  15.                         Utils.m_appLogger.Info("DEV-596 - Calling ConnectToServer failed. Attempting again.");
  16.                         continue;
  17.                     }
  18.                     Utils.m_appLogger.Info("DEV-596 - Calling SendMessage");
  19.                     ProcessResult result = SendMessage(inputmsg);
  20.                     if (result == ProcessResult.FAILURE)
  21.                     {
  22.                         Utils.m_appLogger.Info("DEV-596 - Calling SendMessage failed. Calling closeConnection() Attempting again.");
  23.                         continue;
  24.                        
  25.                     }
  26.                     Utils.m_appLogger.Info("DEV-596 - Calling ReadMessage");
  27.                     outputmsg = ReadMessage();
  28.                     if (String.IsNullOrEmpty(outputmsg.Trim()))
  29.                     {
  30.                         Utils.m_appLogger.Info("DEV-596 - Calling SendMessage failed. Calling closeConnection() Attempting again.");
  31.                         continue;
  32.                     }
  33.                     closeConnection();
  34.                     break;
  35.                    
  36.                 }
  37.                 catch (Exception ex)
  38.                 {
  39.                     Utils.m_appLogger.Fatal("EXception in TransmitMessage",ex);
  40.                     continue;
  41.                    
  42.                 }
  43.             }
  44.             Utils.m_appLogger.Info(string.Format("DEV-596 - outputmsg={0}", outputmsg));
  45.  
  46.         }
Add Comment
Please, Sign In to add comment