How can a PHP script detect if a socket has been closed by the remote party?
Share
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.
From socket_read():
This is the fairly standard approach to detecting if a socket is closed in most languages. I don’t believe PHP offers a direct event-style notification (except perhaps something in PEAR).