php 怎么判断client socket断开

WBOY
Release: 2016-06-06 20:23:07
Original
2343 people have browsed it

php 怎么判断client socket断开

回复内容:

php 怎么判断client socket断开

当连接断开时,读写socket的函数会失败。如socket_read()在读取失败时布尔值false。这时可以调用socket_last_error()和socket_strerror()函数得到错误代码和错误信息。可以根据这个判断失败原因是否为连接断开。

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!