| Author | 
		  Message
		 | 
		
		  | bsn | 
		  
		    
			  
				 Posted: Mon Jun 05, 2006 3:32 am    Post subject: Server Client connection | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 01 Jun 2006 Posts: 5 Location: Bangalore 
  | 
		  
		    
			  
				How to specify host name,channel name & QM name,port in a C program that runs to put a message from client machine ?
 
 
In java Environmental variable are easily set.
 
But I am not getting how to set in C.
 
 
Please help me.   
 
Thanks in Advance. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | LuisFer | 
		  
		    
			  
				 Posted: Mon Jun 05, 2006 3:38 am    Post subject: Re: Server Client connection | 
				     | 
			   
			 
		   | 
		
		
		    Partisan
 
 Joined: 17 Aug 2002 Posts: 302
  
  | 
		  
		    
			  
				
   
	| Code: | 
   
  
	
 
 MQCNO   cno = {MQCNO_DEFAULT};  
 
 MQCD    cd  = {MQCD_CLIENT_CONN_DEFAULT};  
 
 
  strncpy(cd.ChannelName,<Your_channel_Name>,MQ_CHANNEL_NAME_LENGTH);
 
   strncpy(cd.ConnectionName,<Your_Conn_Name>,MQ_CONN_NAME_LENGTH);
 
   cno.Version = MQCNO_VERSION_2;
 
   cno.ClientConnPtr = &cd;
 
 
 
   MQCONNX(QMName,
 
           &cno,
 
           &Hcon,
 
           &CompCode,
 
           &Reason);
 
 
 | 
   
 
 
 
Regards | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bsn | 
		  
		    
			  
				 Posted: Mon Jun 05, 2006 3:49 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 01 Jun 2006 Posts: 5 Location: Bangalore 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bsn | 
		  
		    
			  
				 Posted: Tue Jun 06, 2006 6:50 am    Post subject: Server Client Connection | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 01 Jun 2006 Posts: 5 Location: Bangalore 
  | 
		  
		    
			  
				Hi All,
 
    What are the alteration that should be done for a get ( C ) program that runs on a client machine to get message from queue at the server.
 
  I have tried  I did in put program but it is not working.
 
 
Please post your replies.   
 
Thanks in advance. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Tue Jun 06, 2006 6:59 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired) 
  | 
		  
		    
			  
				The CNO structure has to be set to at least V2 ...
 
 
cno.Version = MQCNO_VERSION_2
 
 
see the sample amqscnxc.c
 
 
   
	| Quote: | 
   
  
	| I have tried I did in put program but it is not working | 
   
 
whats happening when you try and run it? _________________ -wayne | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | bsn | 
		  
		    
			  
				 Posted: Tue Jun 06, 2006 10:57 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 01 Jun 2006 Posts: 5 Location: Bangalore 
  | 
		  
		    
			  
				Hi wschutz,
 
    
 
    I got my mistakes and it is  working fine.
 
Thank you for your kind help.   
 
 
I was linking to both mqm.lib & mqic32.lib.It was not connectiong.
 
I removed mqm.lib from link library & it got connected to server queue.
 
   | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | skiv | 
		  
		    
			  
				 Posted: Mon Jul 10, 2006 6:50 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 19 Jun 2006 Posts: 33
  
  | 
		  
		    
			  
				Hi
 
 
May i ask if the client is in java, how can i set the MQCNO version and set the pointer for its securityptr?
 
 
thanks | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |