2,633
社区成员




int CMQAgent::connect(bool bBrowse)
{
if(m_QRequest.name().length() > 0)
{
m_QRequest.setOpenOptions(MQOO_INPUT_AS_Q_DEF | MQOO_BROWSE | MQOO_FAIL_IF_QUIESCING);
}
if(m_QResponse.name().length() > 0)
m_QResponse.setOpenOptions(MQOO_OUTPUT | MQOO_FAIL_IF_QUIESCING);
int nRt = 0;
if(!m_QMgr.connect())
nRt = m_QMgr.reasonCode();
if(nRt == 0 && m_QRequest.name().length()>0)
nRt = m_QRequest.open() ? 0 : m_QRequest.reasonCode();
if(nRt == 0 && m_QResponse.name().length()>0)
nRt = m_QResponse.open() ? 0 : m_QResponse.reasonCode();
return -nRt;
}