Before designing your program you will need to answer some questions:
- Is the server TCP or UDP?
- Are the data sent as ascii or binary integers?
- If the data are binary, are they in Network Byte Order?
- Are the data 16 bit, 32bit or 64bit integers?
Each of these questions will have an impact on your design. You'll need a different type of client for TCP vs. UDP. You'll need to unpack binary numbers. You'll need to unpack binary numbers with a or A depending on length if the numbers are in NBO.
HTH, --traveler | [reply] |
Is the server TCP or UDP?
> the data will be TCP SOCK-STREAM
Are the data sent as ascii or binary integers?
> the data will be binary integers
Network Byte Order?
> the ints will be recieved in NBO must be multiplied
> together and then the answer sent back in NBO
16, 32, or 64 integers?
> ummm.....eheh i don't know would it make a difference?
| [reply] |
If you want to write a simple TCP client then the IO::Socket modules may be the thing for you, they deal with most of the fiddly coding that comes with this sort of thing. As for retrieving those ints I get the feeling that unpack() will be the function of choice, as it works a treat on binary data.
HTH
broquaint | [reply] |
'man perlipc'
Update : To those who modded this down, is a two word reply really insufficient for a one sentance question? (also, man perlipc contains full source for a TCP client/server). | [reply] |