UNO objects in different environments connect via the interprocess bridge. You
can execute calls on UNO object instances, that are located in a different
process.
This is done by converting the method name and the arguments into a byte
stream representation, and sending this package to the remote process, for
example, through a socket connection.
UNO对象在不同的环境中通过进程间的桥的完成通信的,你可以在一个进程中来调用另外一个进程的UNO对象,这是通过将方法名和参数转换成字节流,然后打包发送给远端进程来实现的,比如通过socket来发送字节流,或者命名管道。
下面是我通过ethereal抓取的包:
0000 00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00 …………..E.
0010 00 9c db 37 40 00 40 06 61 22 7f 00 00 01 7f 00 ...7@.@.a”……
0020 00 01 ce 2e 27 0f a0 42 a2 86 ea 67 cb d8 80 18 ….’..B…g….
0030 00 81 fe 90 00 00 01 01 08 0a 06 c3 79 b3 06 c3 …………y…
0040 79 b0 00 00 00 60 00 00 00 01 f8 04 96 00 00 27 y….`………’
0050 63 6f 6d 2e 73 75 6e 2e 73 74 61 72 2e 62 72 69 com.sun.star.bri
0060 64 67 65 2e 58 50 72 6f 74 6f 63 6f 6c 50 72 6f dge.XProtocolPro
0070 70 65 72 74 69 65 73 15 55 72 70 50 72 6f 74 6f perties.UrpProto
0080 63 6f 6c 50 72 6f 70 65 72 74 69 65 73 00 00 14 colProperties…
0090 04 00 00 00 66 7f ad 6e ee e6 4f e3 b5 68 90 df ….f..n..O..h..
00a0 ca 81 1e be 00 00 b3 4f 00 9b …….O..
Block header:
1. size 00 00 00 60 表示数据包的大小,不包含数据包的头,大小是0x60
2. message count 00 00 00 01 表示message的个数是1
Message 1
3. flag:f8 表示:
const sal_uInt8 HDRFLAG_LONGHEADER = 0x80;
const sal_uInt8 HDRFLAG_REQUEST = 0x40;
const sal_uInt8 HDRFLAG_NEWTYPE = 0x20;
const sal_uInt8 HDRFLAG_NEWOID = 0x10;
const sal_uInt8 HDRFLAG_NEWTID = 0x08;
4. 04 表示method id是04
5. nTypeClass: 96
nCacheIndex 00 00
com.sun.star.bridge.XProtocolProperties.UrpProtocolProperties 发送的是URP数据。
我是通过分析OO的code得出前5部的含义的,具体source可参见bridges/source/remote/urp/*
但是后面的感觉不对,所以没有写出来,希望有人能写一个ethereal的插件来完成这个分析工作就好了。
you can got the details about URP from
http://wiki.openoffice.org/wiki/Uno/Remote/Specifications/Uno_Remote_Protocol