Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ciao-users] connect() returns a NULL pCookie; invoke doesn't do anything

0 views
Skip to first unread message

Phlip

unread,
Jun 8, 2006, 4:32:00 PM6/8/06
to ciao-...@cs.wustl.edu
CIAOists:

http://flea.sourceforge.net/PROBLEM-REPORT-FORM_ubuntu.txt

Thanks to Jeff Parson's patch, the last unit test has passed.

Now here's the next one. (Code from the last one migrated into createSender()):

Components::CCMObject_var compSender = createSender();
string idSender = compSender->_interface_repository_id();
CHECK_EQUAL("IDL:Hello/Sender:1.0", idSender);

Components::CCMObject_var compReceiver = createReceiver();
string idReceiver = compReceiver->_interface_repository_id();
CHECK_EQUAL("IDL:Hello/Receiver:1.0", idReceiver);

// got two components. Now link ones facet to anothers receptacle

FacetDescriptionsPointer p(compSender->get_all_facets());
assert(1 == p->length()); // else it ain't the first one
::Components::FacetDescription & desc = *(*p)[0];

Components::Cookie * pCookie = compReceiver->connect("read_message",
desc.facet_ref());

// assert(pCookie); // TODO why no cookie?

// Sender.idl::Hello::trigger::start
CORBA::Request_var start(compSender->_request("start"));
assert(relevant(start));
start->invoke(); // TODO move this to a round-trip test

The first problem is the commented assert(pCookie) fails. Why no
cookie? Did we not connect, even though the connector threw no
exception?

The connect() method spewed "Activating Port
Hello-Sender-idd_click_in". I will presently turn on the Debug system
to see more spew.

Nextly, when I try to invoke() this ersatz connection, I get "My
current color is:ERROR: Enum attribute initialization failed.". That
could be due to there's not really a connection, or because that
invoke() depended on some other system that I'm not using yet.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!

Gan Deng

unread,
Jun 11, 2006, 10:13:57 PM6/11/06
to CIAO Users Mailing List, ciao-...@cs.wustl.edu
Hi Phlip,

I am pretty sure that the cookie implementation for connection
management should work just fine, since DAnCE uses it internally as well.

Please look at the

$CIAO_ROOT/DAnCE/NodeApplication/NodeApplication_Impl.cpp

00681 ::Components::Cookie_var cookie =
00682 comp->connect (connection.portName.in (),
00683 connection.endpoint.in ()
00684 ACE_ENV_ARG_PARAMETER);
00685 ACE_TRY_CHECK;
00686
00687 ACE_CString key = (*create_connection_key (connection));
00688 if (CIAO::debug_level () > 10)
00689 {
00690 ACE_DEBUG ((LM_ERROR, "[BINDING KEY]: %s\n", key.c_str ()));
00691 }
00692 this->cookie_map_.rebind (key, cookie);

for an example.

> The connect() method spewed "Activating Port
> Hello-Sender-idd_click_in". I will presently turn on the Debug system
> to see more spew.
>
> Nextly, when I try to invoke() this ersatz connection, I get "My
> current color is:ERROR: Enum attribute initialization failed.". That
> could be due to there's not really a connection, or because that
> invoke() depended on some other system that I'm not using yet.

This is because the enumeration type attribute of the component is not
initialized properly. This work is usually handled by DAnCE based on the
deployment plan descriptor file.

Thanks,
Gan


Gan Deng

unread,
Jun 11, 2006, 10:13:57 PM6/11/06
to CIAO Users Mailing List, ciao-...@cs.wustl.edu

Jaiganesh Balasubramanian

unread,
Jun 12, 2006, 11:16:22 AM6/12/06
to CIAO Users Mailing List, ciao-...@cs.wustl.edu, Phlip
Hi Philip,

>>The first problem is the commented assert(pCookie) fails. Why no
>>cookie? Did we not connect, even though the connector threw no
>>exception?

Here are some pointers from Jeff Parsons. He has been having trouble
posting to ciao-users, and so i am posting here on his behalf.

Thanks,
Jai

Hi,

As I mentioned in a previous email, it looks to me like
there is no cookie returned with a simplex receptacle
connection. It seems the cookie is needed only for
multiplex receptacle connection, so the various facets
can be distinguished at disconnect time.

The generic connect() operation, where the port name is
passed in, resolves the port name in generated code, and
calls connect_<port name> which, for a simplex receptacle,
returns void, and for a multiplex receptacle, returns
a cookie. The generic operation doesn't know which kind
of port it is, so it has a place to handle a returned
cookie, but you can't assume that it will always be
non-zero.

Jeff

Jaiganesh Balasubramanian

unread,
Jun 12, 2006, 11:16:22 AM6/12/06
to CIAO Users Mailing List, ciao-...@cs.wustl.edu, Phlip

Jaiganesh Balasubramanian

unread,
Jun 12, 2006, 11:25:26 AM6/12/06
to CIAO Users Mailing List, ciao-...@cs.wustl.edu, Phlip
Hi Phlip,

>>Nextly, when I try to invoke() this ersatz connection, I get "My
>>current color is:ERROR: Enum attribute initialization failed.". That
>>could be due to there's not really a connection, or because that
>>invoke() depended on some other system that I'm not using yet.
>
>
> This is because the enumeration type attribute of the component is not
> initialized properly. This work is usually handled by DAnCE based on the
> deployment plan descriptor file.

Please see:

http://www.dre.vanderbilt.edu/~jai/flattened_deploymentplan.cdp

for a version of the deployment plan descriptor that handles "enum"
initializations. Please "grep" for the word "enum" in the descriptor
file, and you should see an example of how to initialize "enums" when
you deploy components using DAnCE.

BTW, this descriptor is also part of the ACE+TAO+CIAO source code, and
should be available at CIAO_ROOT/examples/Hello/descriptors.

However, if you want to "emulate" DAnCE, i understand you would not want
to try this descriptor file. So please let us know, and we will send you
pointers on the CIAO/DAnCE source code, which you need to include to
accomplish "mock DAnCE".

Thanks very much,
Jai

Jaiganesh Balasubramanian

unread,
Jun 12, 2006, 11:25:26 AM6/12/06
to CIAO Users Mailing List, ciao-...@cs.wustl.edu, Phlip

Phlip

unread,
Jun 13, 2006, 1:25:15 AM6/13/06
to CIAO Users Mailing List
Jaiganesh Balasubramanian wrote:

> However, if you want to "emulate" DAnCE, i understand you would not want
> to try this descriptor file. So please let us know, and we will send you
> pointers on the CIAO/DAnCE source code, which you need to include to
> accomplish "mock DAnCE".

I haven't read this whole thread yet, so don't answer that until I hit
the next real question.

But understand I don't want to rebuild DAnCE from scratch. I want to
write unit tests that are just stooopid enough that CIAO objects think
they are DAnCEd. So if a given test case knows two components have
such-and-so hooks and such-and-so enums, I will just write a line or
three of code to hook the hooks and assign the enums.

0 new messages