I have PHP built a socket loop listening port
while (true) {
Recv .....
}
Now trouble, this page F5 re-run no effect, the port has been monitored
I changed the code effect does not come out
We have to restart the machine.
Wow, it happens every time, so it's too much trouble to debug.
Reply to discussion (solution)
So you're not dealing with the listening stuff?
So you're not dealing with the listening stuff? What do you mean, deal with it?
But I changed the contents of the while and the client returned the original thing.
Close the page (PHP), the client still returns like that
The server must be restarted and then re-opened
Just like the cache, but I looked at the shell box, and the port really was listening.
How does the service end soft restart, thank you
Since you are dealing with the data sent by the client, you can contract a termination signal
When you receive the termination signal, you jump out of the loop and Socket_close.
It's not clear.
Theoretically captures a condition within a while, and when satisfied is on break then close is available
As for the cache problem This is strange, how can the socket receive the old information?
Web page to do this kind of content generally to set the immediate expiration (do not cache) and automatic refresh
You can debug it with the CLI mode.
Well, let the client send the termination message, a little bit of security issues, but now don't think about it, you can handle
To#4, I said that the cache is a metaphor for the result of the phenomenon, the socket is locked, anti-repetitive start, the cause is the socket after the boot is not closed, I do not need to listen or stop, can not debug the server update content; For example, someone comes up, sends a Hello, I changed hello to Hallo, no reboot received Hallo, always hello
To#5,cli never heard of Oh, study ~
Thank you, three-bit, knot-post.