ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » when stopping channel, set to INACTIVE

Post new topic  Reply to topic
 when stopping channel, set to INACTIVE « View previous topic :: View next topic » 
Author Message
bamboozled_by_MQ
PostPosted: Thu May 20, 2004 9:31 am    Post subject: when stopping channel, set to INACTIVE Reply with quote

Voyager

Joined: 07 Jan 2004
Posts: 75

hello all,

this function stops the channel correctly, but it puts it in a stopped stated and looking at the pcf book it says you are able to set it to inactive instead what is exactly what I need...but Im struggling with it in C. Can anyone see what Im doing wrong? I get the error: error C2115: 'initializing' : incompatible types -- while compiling..

thanks!

Code:

MQCFIN  inactiveStatus = MQCHS_INACTIVE;

void StopChannel(MQHCONN hConn, MQHOBJ hCommandQ,
                 MQCHAR48 CommandQ, MQCHAR48 ReplyToQ,
                 char* Channel, MQCFIN inactiveStatus);



void StopChannel(MQHCONN hConn,         /* Connection to queue mgr */
                 MQHOBJ hCommandQ,      /* handle to command queue */
                 MQCHAR48 CommandQ,     /* Command queue           */
                 MQCHAR48 ReplyToQ,     /* Reply queue             */
                 char* Channel,         /* Channel name            */
                 MQCFIN  inactiveStatus)  //added

{
    MQLONG      AdminMsgLen;       /* Length of user message buffer   */
    MQBYTE      *pAdminMsg;        /* Ptr to outbound data buffer     */
    MQCFH       *pPCFHeader;       /* Ptr to PCF header structure     */
    MQCFST      *pPCFString;       /* Ptr to PCF string parm block    */
    MQCHAR       ChannelName[MQ_CHANNEL_NAME_LENGTH];
                                   /* Channel Name                    */

   


    /* Set the length for the message buffer */
   AdminMsgLen = MQCFH_STRUC_LENGTH
                + MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH;

    /* Allocate storage for the message buffer and set a pointer to */
    /* its start address.                                           */
    pAdminMsg   = (MQBYTE *)malloc( AdminMsgLen );
    memset(pAdminMsg, '\0', AdminMsgLen);

    /* pPCFHeader is set equal to pAdminMsg in order to provide a */
    /* structure to the newly allocated block of storage. We can  */
    /* then create a request header of the correct format in the  */
    /* message buffer.                                            */
    pPCFHeader  = (MQCFH *)pAdminMsg;

    /* pPCFString is set to point into the message buffer         */
    /* immediately after the command format header. It is used to */
    /* specify the channel name.                                  */
    pPCFString  = (MQCFST *)(pAdminMsg + MQCFH_STRUC_LENGTH);


    /* Setup request header */
    pPCFHeader->Type           = MQCFT_COMMAND;
    pPCFHeader->StrucLength    = MQCFH_STRUC_LENGTH;
    pPCFHeader->Version        = MQCFH_VERSION_1;
    pPCFHeader->Command        = MQCMD_STOP_CHANNEL;
    pPCFHeader->MsgSeqNumber   = MQCFC_LAST;
    pPCFHeader->Control        = MQCFC_LAST;
    pPCFHeader->ParameterCount = 2;   //changed from 1 to 2


    strncpy(ChannelName, Channel, MQ_CHANNEL_NAME_LENGTH);


    /* Setup parameter block */
    pPCFString->Type           = MQCFT_STRING;
    pPCFString->StrucLength    = MQCFST_STRUC_LENGTH_FIXED
                                 + MQ_CHANNEL_NAME_LENGTH;
    pPCFString->Parameter      = MQCACH_CHANNEL_NAME;
    pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
    pPCFString->StringLength   = strlen(ChannelName);
    memset(pPCFString->String, '\0', MQ_CHANNEL_NAME_LENGTH);
    strncpy(pPCFString->String, ChannelName, MQ_CHANNEL_NAME_LENGTH);
    pPCFString->Parameter      = MQIACH_CHANNEL_STATUS;  //added


    /* Put the newly created message to the input queue for the */
    /* MQSeries command server                                  */
    PutMsg(hConn,
               MQFMT_ADMIN,
       hCommandQ,
       CommandQ,
       ReplyToQ,
       (MQBYTE *)pAdminMsg,
       AdminMsgLen);

    /* Free the storage allocated to the message buffer */
    free(pAdminMsg);
}
Back to top
View user's profile Send private message
jed
PostPosted: Fri May 21, 2004 4:30 am    Post subject: Reply with quote

Centurion

Joined: 08 Jan 2004
Posts: 118
Location: MI, USA

let me try to understand u....

u said that the C function that u have stops the channel correctly.... BUT it puts the channel in stopped state.... then, the function as per what the PCF book says will put the channel in inactive state instead of stop state.

then, no when u compile the program u have problems/errors....


a quick check on ur C function, i think u have a problem on the inactiveStatus variable declaration. can't u put the initial value ("MQCHS_INACTIVE") inside the StopChannel function?

wud u mind if i ask u to post the error(s) that u receive when u compile this program?
_________________
Jed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
dnaren
PostPosted: Tue May 25, 2004 8:35 am    Post subject: Reply with quote

Apprentice

Joined: 10 Aug 2001
Posts: 45
Location: Charlotte, NC

would you please stop using cell phone text message lingo here?

u != you
wud != would (or wood?)

You are not saving any money here by shortening your messages.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » when stopping channel, set to INACTIVE
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.