A
A
AlexSer2018-05-14 10:41:19
Programming
AlexSer, 2018-05-14 10:41:19

How to organize data acceptance via TCP\IP?

In previous posts I have already raised the topic of my problem....
1) How to configure socket-server Ratchet?
2) How to organize data loading via TCP?
3) How to get data from COM port in php?
I programmed a php sockets server, but for some reason I didn’t like it, but most likely my hands are hooked, since the topic of sockets is new to me.
Why exactly I didn’t like it:
1) If the socket-server is launched through the application by calling the action, then the page freezes ... I didn’t like it.
2) If you run through the server console, then if it falls or disconnects. That is not convenient every time to run through the console.
Therefore, such an idea arose, below is a diagram.
5af93a8b04d07683372862.jpeg
What is the best way to organize. Please do not look at my entries (Socket client data processing server, I wrote for clarity).
Action steps:
1) The user clicks in the web (Yii2) applications to accept data, a connection is made to the "Data Processing Server", at least through the js socket client.
2)After the user clicked to accept the data, he starts the machine, which sends the data via TCP\IP in Xml format to the data processing server.
3)Js socket client outputs data to the user's page.
4) Data processing and saving in the database.
It seems everything. I hope I didn’t confuse.
The question is on what to create such a data processing server?
I did a php server through a socket, but because of the user's page freezing before receiving data, I did not like it, it is necessary that the user "do not feel" any inconvenience.
In which direction to dig comrades?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lander, 2018-05-14
@AlexSer

What people don't come up with to avoid using socket_set_nonblock()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question