Esempio n. 1
0
 public static void CloseMQConnection()
 {
     if (mqconn != null)
     {
         mqconn.CloseChannel(sendChannel);
         mqconn.CloseChannel(receiveChannel);
         //mqconn.CloseChannel(channel);
         mqconn.closeConnection();
         mqconn = null;
     }
 }
Esempio n. 2
0
 /**
  * 一个客户端只能维护一个长连接
  */
 private static void InitConnection()
 {
     if (mqconn == null)
     {
         lock (obj)
         {
             if (mqconn == null)
             {
                 mqconn = new MQConnection(defaultConnectionFactory(), connStatus);
             }
         }
     }
 }