When my script opens a connection in PHP with fsockopen
and enters into endless while
loop, how can I check inside the loop if connection is still good?
e.g. if my internet went out, the loop would still go, and that is bad. Thanks.
When my script opens a connection in PHP with fsockopen
and enters into endless while
loop, how can I check inside the loop if connection is still good?
e.g. if my internet went out, the loop would still go, and that is bad. Thanks.
收起
fgets() fwrite() and so on will probably fail. Did you try feof()?
报告相同问题?