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