[omniORB] python access to streams

Duncan Grisby dgrisby@uk.research.att.com
Wed, 16 Feb 2000 14:50:39 +0000


On Tuesday 15 February, Ted Horst wrote:

> Is it possible to get access to GIOP encapsulations from python ?
> 
> In Fnorb, to archive a struct to a stream, I would do something like:
> 
> foo = MyIDLStructClass(....)
> stream = CORBA.OctetStream.Encapsulation()
> cursor = stream.cursor()
> tc = CORBA.typecode(foo._FNORB_ID)
> tc._fnorb_marshal_value(cursor, foo)
> encap_string = cursor.stream().data()

Is there any particular reason that you want these to be GIOP
encapsulations?  Do you want to read them from another language?  I
suppose there is some scope for using GIOP's CDR as a cross-language
pickling format. Unless you want cross-platform capabilities, I would
suggest that it is far better to use Python's normal pickle or marshal
modules.

It wouldn't be too hard to add GIOP stream access to omniORBpy, but it
would require additions to the C++ code. As omniORBpy stands, Python
never gets its hands on the marshalled GIOP stream.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --