I have two questions about the MQCONN function.
(1)
Assume a MQ Client and a MQServer are running on different machines.
When a program calls MQCONN(), does it do socket coneect job to make a connection to the MQ Server automatically?
(2)
I am maintaining a C++ program and found out that we made two MQCONN() calls to the same queue manager, but with different connection handle. It looks like the handle ONE is listening(calling mqget() function periodically) all the time. When the handle ONE gets the message size, the program creates a proper buffer and call mqget() function in handle TWO.
My question is :
can we call mqconn() twice to the same queue manager?
It looks like it should be YES, because my code shows it. But, why?
ps. according to the book, we will get a reason code of MQRC_ALREADY_CONNECTED.
Why the program calls the mqGet() function in the handle TWO, not in the handle ONE?
our psedo code is shown following:
(*m_pfnConnect)(m_QueueManagerName, &m_hMQSeriesConnection, &CompCode, &Reason);
(*m_pfnConnect)(m_QueueManagerName, &m_hListenerConnection, &CompCode, &Reason);
(*m_pfnGet)(m_hListenerConnection, m_hListenerQueue, &MessageDescriptor,
&MsgWaitingOptions, DummyMsgLength, m_listenBuffer, &MsgSize,
&CompCode, &Reason);
........
........
.......
(*m_pfnGet)(m_hMQSeriesConnection,
m_hReplyQueue,
&MessageDescriptor,
&GetMsgOptions,
MsgLength,
pMessage,
&MsgLength,
&CompCode,
&Reason);
THanks for your help
(1)
Assume a MQ Client and a MQServer are running on different machines.
When a program calls MQCONN(), does it do socket coneect job to make a connection to the MQ Server automatically?
(2)
I am maintaining a C++ program and found out that we made two MQCONN() calls to the same queue manager, but with different connection handle. It looks like the handle ONE is listening(calling mqget() function periodically) all the time. When the handle ONE gets the message size, the program creates a proper buffer and call mqget() function in handle TWO.
My question is :
can we call mqconn() twice to the same queue manager?
It looks like it should be YES, because my code shows it. But, why?
ps. according to the book, we will get a reason code of MQRC_ALREADY_CONNECTED.
Why the program calls the mqGet() function in the handle TWO, not in the handle ONE?
our psedo code is shown following:
(*m_pfnConnect)(m_QueueManagerName, &m_hMQSeriesConnection, &CompCode, &Reason);
(*m_pfnConnect)(m_QueueManagerName, &m_hListenerConnection, &CompCode, &Reason);
(*m_pfnGet)(m_hListenerConnection, m_hListenerQueue, &MessageDescriptor,
&MsgWaitingOptions, DummyMsgLength, m_listenBuffer, &MsgSize,
&CompCode, &Reason);
........
........
.......
(*m_pfnGet)(m_hMQSeriesConnection,
m_hReplyQueue,
&MessageDescriptor,
&GetMsgOptions,
MsgLength,
pMessage,
&MsgLength,
&CompCode,
&Reason);
THanks for your help