“慢生活”不是懒惰,放慢速度不是拖延时间,而是让我们在生活中寻找到平衡。网站首页慢生活
workerman类TcpConnection的回调属性onMessage
发布时间:2021-12-03 23:39:42作者:雪饮[程序人生]
onMessage说明:callback Connection::$onMessage作用与Worker::$onMessage回调相同,区别是只针对当前连接有效,也就是可以针对某个连接的设置onMessage回调。 实例1:<?phpuse
详细信息>>workerman类TcpConnection的接口destroy
发布时间:2021-12-03 23:39:08作者:雪饮[程序人生]
destroy说明:void Connection::destroy()立刻关闭连接。 与close不同之处是,调用destroy后即使该连接的发送缓冲区还有数据未发送到对端,连接也会立刻被关闭,并立刻触发该连接
详细信息>>workerman类TcpConnection的接口getRemoteIp获取远端对端ip
发布时间:2021-12-03 23:38:26作者:雪饮[程序人生]
getRemoteIp说明:string Connection::getRemoteIp()获得该连接的客户端ip 参数无参数 实例:<?phpuse Workerman\Worker;use Workerman\Connection\TcpConnection;require_o
详细信息>>workerman类TcpConnection的接口getRemotePort获取远端对端端口
发布时间:2021-12-03 23:37:34作者:雪饮[程序人生]
getRemotePort说明:int Connection::getRemotePort()获得该连接的客户端端口 参数无参数 实例:<?phpuse Workerman\Worker;use Workerman\Connection\TcpConnection;requi
详细信息>>workerman类TcpConnection的接口close
发布时间:2021-12-03 23:37:08作者:雪饮[程序人生]
close说明:void Connection::close(mixed $data = '')安全的关闭连接. 调用close会等待发送缓冲区的数据发送完毕后才关闭连接,并触发连接的onClose回调。 参数$data 可选参
详细信息>>