On Jul 11, 2012, at 9:48 PM, Bert Douglas wrote:

> I am using the same message schema, or thrift file in c++ and in erlang.
> Also setting same three fields in a large struct/record.
> Looking at network with wireshark.
> 
> Erlang client sends this:
> 
> 0040        80 01 00 01 00 00  00 06 64 65 74 65 63 74   ........ ..detect
> 0050  00 00 00 00 0c 00 01 08  00 01 00 00 00 7b 04 00   ........ .....{..
> 0060  02 40 5e dd 3a 92 a3 05  53 00 0c 00 02 08 00 01   .@^.:... S.......
> 0070  00 00 00 2a 0c 00 03 00  0c 00 04 00 00 00         ...*.... ......
> 
> C++ client sends this:
> 
>            80 01 00 01 00 00  00 06 64 65 74 65 63 74   ........ ..detect
> 0050  00 00 00 00 0c 00 01 08  00 01 00 00 00 7b 04 00   ........ .....{..
> 0060  02 40 fe 24 0c 9f be 76  c9 00 0c 00 02 08 00 01   .@.$...v ........
> 0070  00 00 03 db 08 00 02 00  00 00 00 0c 00 03 08 00   ........ ........
> 0080  01 00 00 00 00 04 00 02  00 00 00 00 00 00 00 00   ........ ........
> 0090  04 00 03 00 00 00 00 00  00 00 00 04 00 04 00 00   ........ ........
> 00a0  00 00 00 00 00 00 04 00  05 00 00 00 00 00 00 00   ........ ........
> 00b0  00 00 0c 00 04 08 00 01  00 00 00 00 04 00 02 00   ........ ........
> 00c0  00 00 00 00 00 00 00 04  00 03 00 00 00 00 00 00   ........ ........
> 00d0  00 00 04 00 04 00 00 00  00 00 00 00 00 04 00 05   ........ ........
> 00e0  00 00 00 00 00 00 00 00  00 04 00 05 00 00 00 00   ........ ........
> 00f0  00 00 00 00 04 00 06 00  00 00 00 00 00 00 00 08   ........ ........
> 0100  00 07 00 00 00 00 08 00  08 00 00 00 00 08 00 09   ........ ........
> 0110  00 00 00 00 04 00 0a 00  00 00 00 00 00 00 00 04   ........ ........
> 0120  00 0b 00 00 00 00 00 00  00 00 04 00 0c 00 00 00   ........ ........
> 0130  00 00 00 00 00 00 00                               .......
> 
> I would like to dis-assemble this by hand from docs to understand the
> meaning of what is being sent.
> 
> However, so far I have been unable to find a description of the wire format.
> 
> By way of example, the google protocol buffer encoding is described here:
> https://developers.google.com/protocol-buffers/docs/encoding
> 
> Is there a similar document for thrift ?

Hi Bert,

AFAIK, there is no such document for Thrift. However, for someone who is 
looking at the packets with wireshark I feel it's reasonable to suggest that 
you just trace through the client side message send. Just set a breakpoint in 
the write() method in your *_types.cpp file and watch how it fills the transmit 
buffer.

This is good for the C++ client. I'm afraid that I have no idea how to do the 
equivalent with the erlang side.

Best regards,
Rush

Reply via email to