Maninder
November 23rd, 2001, 02:36 AM
Hello,
I had made an application which prepares a byte stream and sends it to other machine on TCP/IP.I made it on SUN Netra machine and the other machine is also on sun netra.
When I recompile the same code on Compaq Dec Alpha machine the same message is not in the right order.
message on SUN
0000 0024 0000 0002 0000 0000 0000 0001
3132 3334 3500 7061 7373 0056 4d43 5749
0033 0000
message on Compaq
2400 0000 0200 0000 0000 0000 0100 0000
3132 3334 3500 7061 7373 0056 4d43 5749
0033 0000
Any suggestions......
the relevant code for preparation of bytestream is
int len=36, cmdid=2, cmdstat=0, seqNum=0;
int smpver=0x33;
sendmsg=(char *)malloc(len);
memcpy(sendmsg,(void*)&len,4);
memcpy(sendmsg+4,(void*)&cmdId,4);
memcpy(sendmsg+8,(void*)&cmdStat,4);
memcpy(sendmsg+12,(void*)&seqNum,4);
memcpy(sendmsg+16,(void*)argv[3],strlen(argv[3])+1);
memcpy(sendmsg+16+strlen(argv[3])+1,(void*)argv[4],strlen(argv[4])+1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1,(void*)argv[5],strlen(argv[5])+1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1,(void*)&smpver,1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1+1,(void*)&null,1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1+1+1,(void*)&null,1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1+1+1+1,(void*)&null,1);
I had made an application which prepares a byte stream and sends it to other machine on TCP/IP.I made it on SUN Netra machine and the other machine is also on sun netra.
When I recompile the same code on Compaq Dec Alpha machine the same message is not in the right order.
message on SUN
0000 0024 0000 0002 0000 0000 0000 0001
3132 3334 3500 7061 7373 0056 4d43 5749
0033 0000
message on Compaq
2400 0000 0200 0000 0000 0000 0100 0000
3132 3334 3500 7061 7373 0056 4d43 5749
0033 0000
Any suggestions......
the relevant code for preparation of bytestream is
int len=36, cmdid=2, cmdstat=0, seqNum=0;
int smpver=0x33;
sendmsg=(char *)malloc(len);
memcpy(sendmsg,(void*)&len,4);
memcpy(sendmsg+4,(void*)&cmdId,4);
memcpy(sendmsg+8,(void*)&cmdStat,4);
memcpy(sendmsg+12,(void*)&seqNum,4);
memcpy(sendmsg+16,(void*)argv[3],strlen(argv[3])+1);
memcpy(sendmsg+16+strlen(argv[3])+1,(void*)argv[4],strlen(argv[4])+1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1,(void*)argv[5],strlen(argv[5])+1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1,(void*)&smpver,1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1+1,(void*)&null,1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1+1+1,(void*)&null,1);
memcpy(sendmsg+16+strlen(argv[3])+1+strlen(argv[4])+1+strlen(argv[5])+1+1+1+1,(void*)&null,1);