M
M
Maxim E2014-11-24 19:43:47
PHP
Maxim E, 2014-11-24 19:43:47

How to write data coming over TCP/IP to MySQL (preferably in PHP)?

There is data that comes via TCP / IP to a dedicated IP, of the format

01-00-0C-s1-s2-s3-s4-s5-s6-s7-s8-p1-p2-p3-p4-04-HH-LL-char1-char2-char3...

It is necessary to write data to the mysql database, it is desirable to implement it in PHP, but not necessary. Please advise solutions.
As I understand it, you need to listen on the port on which the data comes and process it.
Unix server, can be configured as you like.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2014-12-20
@creativeworm

You need to organize work with sockets at the php level.
Here you can see an example of a tcp/ip server.
If you need to write to the database, then connect mysql and write there.
If you use some kind of standard protocol, then it is better to look among ready-made solutions, it is very likely that there will be something that suits you or can be customized to suit your needs.

B
Boris Benkovsky, 2014-11-24
@benbor

Well, for example, you have not a simple system, but an effective ratcherphp based on ReactPHP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question