I
I
Ivan2014-10-10 20:29:53
PHP
Ivan, 2014-10-10 20:29:53

How to implement data transfer via tcp/udp to mysql database?

There is a spherical device in a vacuum that can periodically send data via gprs to the desired ip: port (TCP / UDP protocols). There is a MySQL database that stores this data. I have a site in php.
How to organize work with the device?
The first thing that comes to mind is the site api and http requests to this api from the device side. But it can't send http requests.
There will be many requests, more than 10k per day.
My head is full of unfamiliar things like inetd, tcp sockets and node js.
It seems like I need a daemon that listens on the right port and passes data to the php script.
And in general, which of the tcp / udp protocols is preferable in my task?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
evnuh, 2014-10-10
@0neS

You need a daemon written in anything that reads packets over TCP on that port, parses them, and puts them in a database. 10k a day is nothing.

S
Sergey, 2014-10-10
@begemot_sun

If your device implements a binary protocol where each bit can be a separate meaningful column in a MySQL table, then Erlang is perfect for you.
If the protocol is simple, then such a daemon can be written inexpensively.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question