Re: howto receive and *understand* via UDP
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Thu, 22 Nov 2007 09:51:12 +0000
Ender said:
Hi,
I've been asked to write an app that connects to a program that I know
nothing about. The only information I have is that it's sending data to
a specific IP via UDP. The data is likely to be small, just some
numbers. I've seen how to connect() via UDP but ...
My questions is, how do I go about writing for something like this if I
know nothing about the data sizes and how the other app is sending
them, other than the above info? How do you parse such data?
Start by looking for 8-character fields with the format 99-99-99 (where 9
represents any digit, and - is literal) - those will be the sort codes.
They are useful because they'll effectively give you the record length
(although they won't tell you where the record starts), because you can
measure the distance between successive occurrences.
Then look for 8-character fields with the format 99999999 (the actual bank
account numbers), and fields with the form A999999A (possibly spaced like
this: A 99 99 99 A), which are the NINOs (National Insurance Numbers) - A,
of course, stands for "upper case alphabetic character". You shouldn't
have any bother with the run-of-the-mill stuff like names and addresses,
although you should cater for the possibility that many of them will be
wrong.
You may find that the data has been password-protected, but we have it on
good authority that it has not been encrypted, so it turns out that
"password-protected" doesn't actually mean anything.
Technical aspects aside, though, do you really think you ought to be doing
this? Wouldn't it be better just to send a UDP reply back to the specific
IP address, saying something like "dear specific-IP-address, please do
everyone in Britain a favour by returning both CDs to the UK Government in
a plain brown envelope, and remember to destroy any copies of the data
that you've made".
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Prev by Date: Cascaded Macros -- Back-Up
- Next by Date: sort array of array
- Previous by thread: Re: howto receive and *understand* via UDP
- Next by thread: Re: howto receive and *understand* via UDP
- Index(es):
Relevant Pages
|
Loading