carcassonne has asked for the wisdom of the Perl Monks concerning the following question:
What approaches can be used in Perl for receiving/sending data to a server written in C that expects said data to be exactly delimited according to C types ? Like:
struct Result { DWORD var1; BYTE var2; WORD var3; short var4; int var5; float var6; };
The server expects the exact data lengths for each variable because it simply 'shifts' the bytes as they come in into its appropriate structures.
Are there recipes to shape Perl internal data representation to fit C structures before sending them in the network ?
Same for receiving C data: Are there recipes to read in C data and use Perl hashes based on the C structure definition ?
Is there a Perl module (or modules) that can help ?
Thanks !
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Working with C structures over network
by Corion (Patriarch) on Jan 30, 2006 at 20:21 UTC | |
|
Re: Working with C structures over network
by explorer (Chaplain) on Jan 30, 2006 at 20:19 UTC | |
|
Re: Working with C structures over network
by BrowserUk (Patriarch) on Jan 30, 2006 at 21:11 UTC | |
|
Re: Working with C structures over network
by ikegami (Patriarch) on Jan 30, 2006 at 20:27 UTC |