Libevent is one of the recommended cool-level network libraries that I've seen before, and I'd like to know about it. Today downloaded to a person to write the analysis series, from the structure and the source of a brief analysis. But this analysis
The following assumes that you have learned basic socket programming (socket, bind, listen, accept, connect, Recv, send, close) and have a basic understanding of asynchronous/callback.
Basic socket programming is congested/synchronized. Each
Event_base_free () frees the resource, which cannot destroy the binding event
Event_base_loop () Handles events and handles event loops based on the specified base
Event_base_loopbreak () immediately cancels the event loop, with the same behavior
PHP uses pcntl and libevent to implement the Timer function. PHP uses pcntl and libevent to implement the Timer function. let's take a look at the example. the pcntl (PHP thread) is explained below. Copy the code as follows :? PhpfunctionnewChild ($
The libevent extension is configured on php. the online tutorial says to decompress libevent0.1.0.tgz and execute. configure, but the downloaded package does not have the configure file. there is no way to install it according to this command. how
Install the Memcache server in Linux. In linux, memcache server installation server is mainly to install memcache server, the latest version is memcached-1.3.0. Download: install the memcache server in www. danga. commemcacheddistme linux.
The
PHP uses PCNTL and libevent to implement the timer function, first look at the example, Pcntl (PHP thread) explained below.
Copy CodeThe code is as follows:
function NewChild ($func _name) {
echo "Enter newchild\n";
$args = Func_get_args
Linux under Memcache server-side installation
Server side is mainly installed Memcache server side, the current version is memcached-1.3.0.
Download: http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz
In addition, Memcache used the libevent
Download: http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gzIn addition, memcache uses the libevent library for socket processing, so you also need to install libevent, the latest version of libevent is the libevent-1.3. (If your system has
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.