I have to build up a system which listens for requests from a GPS device which is only capable of sending UDP requests. Then I am going to analyze requests hopefully by PHP if it is possible.
I do not know where to start. What do I need? Can I make use of PHP? Would it be reliable to use PHP? Can I just adjust Apache for listening UDP requests?
I do not know where to start.
You need a notion of an overall program design, and, as @karim79 pointed out, an understanding of socket programming APIs for your chosen language.
Can I just adjust Apache for listening UDP requests?
Do you mean the Apache httpd
? The short answer is "no."
Use something like PEAR's System_Daemon
instead.
The long answer is "yes, that is possible." Particularly with modular plugins exposing the httpd
's internals, you can do Just About Anything You Want (tm) (see, for instance, mod_perl
). You could beat httpd
into a sort of application server for a long-running (set of?) PHP process(es) which are not themselves intrinsically HTTP-driven.
The better answer of the two is, again, "no." :)
By all accounts I think PHP should be fine for that, but I haven't done anything like that myself. You will need to look into socket programming, here's a tutorial:
http://www.devshed.com/c/a/PHP/Socket-Programming-With-PHP/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With