Do not automatically close the connection when blocking=0 (non-blocking mode)
Properly exit loops after disconnects / connection losses
Before (without this change):
Aborting an e. g. TeamSpeak bot script resulted most of the time in a stuck script, which never finished / exited
Loosing the connection to the TeamSpeak server resulted most of the time in an endless loop, which caused a lot of disk I/O: pselect6(13, [12], [], [], {tv_sec=10, tv_nsec=0}, NULL) = 1 (in [12], left {tv_sec=9, tv_nsec=999998860}) (see https://linux.die.net/man/2/pselect6)
PHP script caused a very high CPU utilization (95-130 % on a single core system)
After (with this change):
Aborting an e. g. TeamSpeak bot script properly finishes / exits the script immediately (NOT stuck anymore)
Loosing the connection to the TeamSpeak server properly finishes / exits the script immediately (NO endless loop anymore and thus no disk I/O anymore)
PHP script does NOT cause any high CPU utilization anymore
Changes:
blocking=0
(non-blocking mode)Before (without this change):
pselect6(13, [12], [], [], {tv_sec=10, tv_nsec=0}, NULL) = 1 (in [12], left {tv_sec=9, tv_nsec=999998860})
(see https://linux.die.net/man/2/pselect6)After (with this change):
Closes #204