Omniorb event channel question

  • Thread starter Attila Rajmund Nohl
  • Start date
A

Attila Rajmund Nohl

Hello!

I'm using python 2.3.5 on Linux with omniORB 2.6. I'm trying to create
an object that shall listen on an event channel, but the registration
doesn't work. My code is:

class EventListener(CosEventComm.PushConsumer):

def __init__(self):
pass

def push(self, data):
print data.typecode().kind()
print data.typecode().name()

def disconnect_push_consumer(self):
pass

[... initalize the ORB ...]

channel = orb.getRootInterface(channelname)
chadmin = channel.for_consumers()
supplier = chadmin.obtain_push_supplier()
listener = EventListener()
supplier.connect_push_consumer(listener)

Unfortunately I get the following error at this point:
omniORB.CORBA.BAD_PARAM
Traceback (most recent call last)

test.py
70 supplier = chadmin.obtain_push_supplier()
71 listener = EventListener()
---> 72 supplier.connect_push_consumer(listener)
73
74

CosEventChannelAdmin_idl.py
in connect_push_consumer(self, *args)
122
123 def connect_push_consumer(self, *args):
--> 124 return _omnipy.invoke(self, "connect_push_consumer",
_0_CosEventChannelAdmin.ProxyPushSupplier._d_connect_push_consumer, args)
125
126 __methods__ = ["connect_push_consumer"] +
_0_CosEventComm._objref_PushSupplier.__methods__

BAD_PARAM: Minor: BAD_PARAM_WrongPythonType, COMPLETED_NO.

What am I missing? The ORB works otherwise.

Bye,NAR
 
D

Diez B. Roggisch

channel = orb.getRootInterface(channelname)
chadmin = channel.for_consumers()
supplier = chadmin.obtain_push_supplier()
listener = EventListener()
supplier.connect_push_consumer(listener)

Not sure, but I guess you want a

listener._this()

here.

Diez
 
A

Attila Rajmund Nohl

Diez B. Roggisch said:
Not sure, but I guess you want a

listener._this()

here.

That worked, thanks. However, the event receiving doesn't seem to work.
I've started the ORB with
corba.orb.run()

but the push() method of the EventListener object doesn't get called (or
at least the print() calls in the method are not executed) and the event
sender program is blocked in the push() call. Do I need something else
to set up?
Bye,NAR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,283
Messages
2,571,409
Members
48,102
Latest member
charleswillson

Latest Threads

Top