So I am working on this Ruby server application for Windows that needs
to communicate with a client.  Standard TCP sockets are being used, but
the data being passed is kind of weird.  The problem is mostly that the
program I am communicating with on the client is a C++ program I cannot
modify.  However, there is a binary interface I have the documentation
for that if I can make all data passed match the documentation, then it
should work.

My main concern is that the documentation is VERY specific.  As in the
first four bytes has to be a unsigned long, the next two bytes has to be
a unsigned short, and the next is a unsigned char.  Then some places in
the interface allow for a string of length N and the only guarantee is
the string will be null terminated to determine the end of it.  And then
there are some odd data types used like this one four byte data type
only referred to as "DWORD" and this eight byte data type called
"FILETIME.dwLowDateTime(DWORD)".

Any advice for doing this type of binary IO?
-- 
Posted via http://www.ruby-forum.com/.