Home > Article > PHP Framework > 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 inThe above is the detailed content of How to use swoole constants. For more information, please follow other related articles on the PHP Chinese website!