|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
when stopping channel, set to INACTIVE |
« View previous topic :: View next topic » |
Author |
Message
|
bamboozled_by_MQ |
Posted: Thu May 20, 2004 9:31 am Post subject: when stopping channel, set to INACTIVE |
|
|
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 |
|
 |
jed |
Posted: Fri May 21, 2004 4:30 am Post subject: |
|
|
 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 |
|
 |
dnaren |
Posted: Tue May 25, 2004 8:35 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|