Home > Backend Development > PHP Tutorial > How to obtain unclosed socket resources in php? ?

How to obtain unclosed socket resources in php? ?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-21 14:12:53
Original
860 people have browsed it

After creating $socket = socket_create -> socket_bind -> socket_listen, the $socket resource is not closed.

When I reopen this page, how can I use the $socket resource created last time? ?

Reply content:

After creating $socket = socket_create -> socket_bind -> socket_listen, the $socket resource is not closed.

When I reopen this page, how can I use the $socket resource created last time? ?

If you are in an fpm environment, then I can tell you that it is impossible. This kind of resource will be released uniformly after the end of a request.
If you want to maintain a persistent connection in php, you need to have a cli Start long-running environment

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template