we have a system that we deploy and other ysstems use that system from client locations, now these systems contact the server using a socket connection .
i have been thinking about why and without any research this is why i reckon,
1, http requires web server wich is unstable, a socket server that you have created will be there only for one reason and thats to listen for your device, nothing else will use it, you can send each char of your message start message and end one by one with a checksum to make sure the data is solid. there is little chance of teh server falling and if it does it wont affect your web server.
you can monitor it in your script what comes throgh etc etc.
HTTP is a protocol that runs on a socket, and a socket is what is used to
transport data between systems. If you want to run your *own* protocol,
create a new socket (TCP or UDP) using an *unused* port (e.g. 1001), and
then send *your* protocol down it!
basicaly creating your own socket the application is more pure no web server stuff less to fail
http has its own protocol used in socket communication http is a protocol socket is a loop running on your server listening to a port.
you dont need teh http protocol, i think you get the idea
you can use a filename.php with a socket
so if you communicate to filename.php you can comunicate with it on multiple sockets
filename.php:1000
filename.php:2000
etc
but teh code inside the file will be listening for whatever port and teh data posted to it
read this
http://bytes.com/groups/net-vb/367435-sockets-vs-http