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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
fgets() fwrite() and so on will probably fail. Did you try feof()?