Home > other >  How to realize the web server to return information to dynamic IP?
How to realize the web server to return information to dynamic IP?

Time:10-03

I do website in PHP, using the tcpip protocol and the next bit machine communication, mobile web page setup insecticidal lamp's phone number, and then insecticidal lamp after receiving will have a response back to the server (written in C language, compiled on ali cloud has been running), but the pages on the server to return information tell phone, already set a success this step how to implement?
Mobile web pages - & gt; Server - & gt; Insecticidal lamp - & gt; Server - & gt; Mobile web page, I'm stuck in the last step: server - & gt; Mobile web site, because the mobile IP is dynamic, and cannot remember IP way,

CodePudding user response:

The understanding of the communication process is not very accurate,
Access to the WEB server, a complete communication process is: the browser - Request - & gt; A web server - the Response - & gt; Browser (no Response is not can't, just in general, as a Response, have the effect of a feedback),
And rarely appear a web server to the client (browser) actively to push the scene (to do also can, websocket),
If encounter this kind of situation, a request, feedback for many times, can use multipart/x - mixed - replace message last response, may also directly bring a websocket, but you do not need such scene, just one of the most basic web server response process, do not need to know the client's IP,
Phone/PC - request - & gt; Web server - performing background logic (control lamp, write database) - & gt; Response in response to phone, ok,

CodePudding user response:

There is also a forgot to say, the browser regularly polling can do take the information to the server, such as write a timing in js, every 3 seconds with ajax sends a request to the server
  • Related