Home  >  Article  >  PHP Framework  >  How to use swoole constants

How to use swoole constants

(*-*)浩
(*-*)浩Original
2019-12-06 10:12:582646browse

How to use swoole constants

Constant

SWOOLE_VERSION Current Swoole version number, string type, such as 1.6.0 (recommended learning: swoole video tutorial)

Client::MSG_WAITALL

Used for the second parameter of the Client->recv() method, blocking and waiting Returns after receiving data of specified length.

$client->recv(8192, Client::MSG_PEEK | Client::MSG_DONTWAIT);

Client::MSG_DONTWAIT

Non-blocking reception of data, it will return immediately regardless of whether there is data or not.

Client::MSG_PEEK

Peep the data in the socket buffer. After setting the MSG_PEEK parameter, recv will not modify the pointer when reading data, so the next call to recv will still return data from the previous position.

Client::MSG_OOB

Read out-of-band data.

Constructor parameters

SWOOLE_BASE Using Base mode, the business code is executed directly in the Reactor process

SWOOLE_PROCESS Using process mode, the business code is executed in the Worker process Execute in

The above is the detailed content of How to use swoole constants. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:How to use swooleNext article:How to use swoole