[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mico-announce
Subject:    [mico-devel] multiple requests
From:       "JimJim" <FreeBSD_net () blueyonder ! co ! uk>
Date:       2004-01-31 19:57:02
Message-ID: 002801c3e834$64cfcfb0$1900a8c0 () TAZ500
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

    I m trying to re-implement the EventService's push communication with multiple \
requests, which is a part of my university project. So I have altered the \
EventChannel_impl::notify(const CORBA::Any &any) function like this:

CORBA::ORB_var orb;
CORBA::Context_ptr ctx;
CORBA::NVList_ptr  arg_list;
CORBA::Request_ptr requestss[50];
CORBA::NamedValue_ptr result;
CORBA::ULong  k = 0;
CORBA::Long  l = 1 ;
CORBA::Object_var obj;

orb->get_default_context(ctx);
orb->create_named_value(result);
orb->create_list( l, arg_list);  


for (i = _push_supp.begin(); i != _push_supp.end (); i++)
  {
    (*i)->notify (any);  // in ProxyPushSupplier_impl::notify () the \
req->send_deferred (this); statement was removed  obj = (*i)->return_consumer();  //I \
added the return_consumer( ) method in the CosEventChannel::ProxyPushSupplier \
interface  
   //the following returns a valid PushConsumer obj (e.g I invoked \
consumer->push(any); after right after this statement and I saw my   //event data \
appearring at the consumer side  CosEventComm::PushConsumer_var consumer = \
CosEventComm::PushConsumer::_narrow(obj);

  arg_list->add_value("arg1", any, CORBA::ARG_IN);

  consumer->_create_request(ctx,"push",arg_list,result,requestss[k++],0);
 }

        CORBA::ORB::RequestSeq rseq ( k, k, requestss);
        orb->send_multiple_requests_deferred (rseq);

    The above compiles fine but no event data appear at the consumers. I put the \
above  in a main( )  and made a sample server and realised that the multiple requests \
code works fine.

    Any pointers are wellcome. Thank you in advance.


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-7">
<META content="MSHTML 6.00.2734.1600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; I m trying to re-implement the 
EventService's push communication with multiple requests, which is a part of my 
university project. So I have altered the EventChannel_impl::notify(const 
CORBA::Any &amp;any) function like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>CORBA::ORB_var orb;<BR>CORBA::Context_ptr 
ctx;<BR>CORBA::NVList_ptr&nbsp; arg_list;<BR>CORBA::Request_ptr 
requestss[50];<BR>CORBA::NamedValue_ptr result;<BR>CORBA::ULong&nbsp; k = 
0;<BR>CORBA::Long&nbsp; l = 1 ;<BR>CORBA::Object_var 
obj;<BR><BR>orb-&gt;get_default_context(ctx);<BR>orb-&gt;create_named_value(result);<BR>orb-&gt;create_list( \
 l, arg_list);&nbsp; </FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>for (i = _push_supp.begin(); i != _push_supp.end 
(); i++)</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp; {</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; (*i)-&gt;notify (any);&nbsp; 
<EM>// in ProxyPushSupplier_impl::notify () the req-&gt;send_deferred (this); 
statement was removed</EM></FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;obj = 
(*i)-&gt;return_consumer();&nbsp; <EM>//I added the return_consumer( ) method in 
the <FONT face="Times New Roman" size=3>CosEventChannel::ProxyPushSupplier 
interface</FONT></EM></FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>&nbsp;&nbsp; 
<FONT face=Arial size=2><EM>//the following returns a valid PushConsumer obj 
(e.g <STRONG>I invoked consumer-&gt;push(any);</STRONG> after right after this 
statement and I saw my </EM></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3><FONT 
face=Arial size=2><EM>&nbsp;&nbsp; //event data appearring at 
the&nbsp;</EM></FONT></FONT></FONT><FONT face=Arial size=2><FONT 
face="Times New Roman" size=3><FONT face=Arial size=2><EM>consumer 
side</EM></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>&nbsp;&nbsp; 
CosEventComm::PushConsumer_var consumer = 
CosEventComm::PushConsumer::_narrow(obj);</FONT><BR><FONT face="Times New Roman" 
size=3></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>&nbsp; 
arg_list-&gt;add_value("arg1", any, CORBA::ARG_IN);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" 
size=3></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>&nbsp; 
consumer-&gt;_create_request(ctx,"push",arg_list,result,requestss[k++],0);</FONT></DIV></FONT>
 <DIV><FONT face=Arial size=2>&nbsp;}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;<FONT face="Times New Roman" 
size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CORBA::ORB::RequestSeq rseq ( k, k, 
requestss);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
orb-&gt;send_multiple_requests_deferred (rseq);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" 
size=3></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" 
size=3>&nbsp;&nbsp;&nbsp; The above&nbsp;compiles fine but&nbsp;no event data 
appear at the consumers.&nbsp;I put the&nbsp;above&nbsp; in a main( ) &nbsp;and 
made a sample server and realised that the multiple requests code&nbsp;works 
fine.</FONT></FONT><FONT face=Arial></DIV><FONT size=2></FONT>
<DIV><BR><FONT size=2>&nbsp;&nbsp;</FONT><FONT face="Times New Roman" 
size=3>&nbsp; Any pointers are wellcome. Thank you in 
advance.</FONT></DIV></FONT></BODY></HTML>



_______________________________________________
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic