[Csci551-talk] Last ls message dump
John Heidemann
johnh at ISI.EDU
Wed Mar 24 18:32:57 PST 2004
On Wed, 24 Mar 2004 01:21:35 PST, "Raymond Pun" wrote:
>hi,
>
>is there any format i have to follow for the message dump?
>What I am now doing is simply print out the msg byte by byte, straight
>forward... disregarding the endian and the structure of the message. I found
>my dump is different from the sample output.
>e.g.
>for the sequence number 1, the sample output will have 0001, mine will have
>0100.
>will it be a problem?
>
>regards,
>Raymond
YES, you should just print out the message byte-wise, as per this
code:
char *message; // should be pointer to your raw, over-the-wire message
for (int i = 0; i < NUMBER_OF_BYTES_SENT; i++) {
char buf[10];
sprintf(buf, "%02x", message[i]);
cout << buf;
};
If your output doesn't match ours, then that would indicate that you
have improperly encoded your message.
(See the discussion on the list about marshalling!)
-John Heidemann
More information about the Csci551-talk
mailing list