ballybeg
Member
Hey all,
I am working on a project that requires data transfer using TCPIP sockets. I am using a 3rd party Library (Ostrosoft) that handles the
wsock32.dll api calls.
The project calls for the creation of a header that logs into a user account. Here is the header:
[TABLE="class: cms_table, width: 562"]
[TR]
[TH]Name[/TH]
[TH]Length[/TH]
[TH]Format[/TH]
[TH]Value[/TH]
[/TR]
[TR]
[TD]Marker[/TD]
[TD]4[/TD]
[TD]Binary[/TD]
[TD]4,275,878,552[/TD]
[/TR]
[TR]
[TD]MSN[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Message Type[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]4096[/TD]
[/TR]
[TR]
[TD]Message Length[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]54[/TD]
[/TR]
[TR]
[TD]Action Code[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]4096[/TD]
[/TR]
[TR]
[TD]Error Code[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]0[/TD]
[/TR]
[/TABLE]
In hex the result looks like this:
Header HEX
Start marker <4275878552> FE DC BA 98
MSN <0> 00 00
Message type <4096> 10 00
Message length <54> 00 36
Action code <4096> 10 00
Error code <0> 00 00
My questions are:
1) If I define the marker (value 4,275,878,552) what data type should it be
2) What function do I use to convert the values into a binary format?
The final complication is message has to be submitted in network byte order! How do I do that?
Assistance greatly appreciated.
ballybeg
I am working on a project that requires data transfer using TCPIP sockets. I am using a 3rd party Library (Ostrosoft) that handles the
wsock32.dll api calls.
The project calls for the creation of a header that logs into a user account. Here is the header:
[TABLE="class: cms_table, width: 562"]
[TR]
[TH]Name[/TH]
[TH]Length[/TH]
[TH]Format[/TH]
[TH]Value[/TH]
[/TR]
[TR]
[TD]Marker[/TD]
[TD]4[/TD]
[TD]Binary[/TD]
[TD]4,275,878,552[/TD]
[/TR]
[TR]
[TD]MSN[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Message Type[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]4096[/TD]
[/TR]
[TR]
[TD]Message Length[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]54[/TD]
[/TR]
[TR]
[TD]Action Code[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]4096[/TD]
[/TR]
[TR]
[TD]Error Code[/TD]
[TD]2[/TD]
[TD]Binary[/TD]
[TD]0[/TD]
[/TR]
[/TABLE]
In hex the result looks like this:
Header HEX
Start marker <4275878552> FE DC BA 98
MSN <0> 00 00
Message type <4096> 10 00
Message length <54> 00 36
Action code <4096> 10 00
Error code <0> 00 00
My questions are:
1) If I define the marker (value 4,275,878,552) what data type should it be
2) What function do I use to convert the values into a binary format?
The final complication is message has to be submitted in network byte order! How do I do that?
Assistance greatly appreciated.
ballybeg