Author |
Message
|
alperb |
Posted: Tue Apr 19, 2005 9:39 am Post subject: Client Connection |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 25
|
Hi,
I am trying to connect to a remote manager with the following code where I copied the whole from imqsput.cpp.
imqsputc.exe works fine with alpers/TCP/10.1.1.34(1414) parameters however I get 2058 reason code with the code below.
The same code, the same client, the same server but different results.
Can anybody help me?
thanks in advance
ImqChannel * pchannel = 0 ;
pchannel = new ImqChannel ;
pchannel -> setHeartBeatInterval( 1 );
pchannel->setChannelName("alpers");
pchannel->setTransportType( MQXPT_TCP );
pchannel->setConnectionName("10.1.1.34(1414)");
qmgr.setChannelReference(pchannel);
qmgr.setName("MQTEST");
if ( !qmgr.connect( ) )
{ return RET_ERR;} |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Apr 19, 2005 12:10 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
MQTEST is the wrong Queue Manager name for that particular hostname and port number. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
malammik |
Posted: Tue Apr 19, 2005 12:21 pm Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
I am not sure I understand 100%. Are you saying it work from one client but with same params does not work from another client? If the answer is yes, there might be a network/subnet/firewall issue.
Try pinging queue manager host from your client machine. Also try telneting into port 1414 of the queue manager machine and see what u get. _________________ Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Apr 19, 2005 1:40 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
2058 means that you found a qmgr and that you had the wrong name. Try issuing the dspmq command to verify the qmgr name. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 19, 2005 5:23 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Could the qmgr name be QMTEST instead of MQTEST ??
 |
|
Back to top |
|
 |
alperb |
Posted: Tue Apr 19, 2005 11:29 pm Post subject: |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 25
|
queue manager name is MQTEST I tried dspmq as bower suggested and it all seem OK.
imqsputc.exe works fine with these parameters , channel name, connection name, queue manager name.
I just copied the imqsputc code to another project and hard coded the parameters. |
|
Back to top |
|
 |
alperb |
Posted: Wed Apr 20, 2005 12:31 am Post subject: |
|
|
Apprentice
Joined: 01 Jun 2004 Posts: 25
|
I reinstalled Mqclient 5.3 and the 2058 problem is solved.
However I began to get 2277 with the same code. It says
"MQRC_CD_ERROR
An MQCONNX call was issued to connect to a queue manager, but the MQCD channel definition structure addressed by the ClientConnOffset or ClientConnPtr field in MQCNO contains data that is not valid. Consult the WebSphere MQ error log for more information about the nature of the error.
Corrective action: Ensure that required input fields in the MQCD structure are set correctly. "
I thought the server connection definition may be wrong but it works fine with imqsputc.
what can be done? |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Apr 20, 2005 6:26 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I'd double check your code. It sounds like you have a pointer messed up somewhere. Did you do any string copies of strings that weren't null terminated? |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Apr 20, 2005 8:02 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
|
Back to top |
|
 |
|