Ubuntu Virtual Machine Installation EVPP Open Source Library description

Source: Internet
Author: User
Tags net domain git clone



Ubuntu Virtual machine Installation Open Source Library Description:



EVPP for Qihoo based on Libevent developed modern high-performance network library supporting C++11 features, asynchronous non-blocking server and client libraries with protocols such as Tcp/udp/http. Has the following features:



* Modern version of the C++11 interface
* Non-blocking asynchronous interfaces are c++11 functional/bind form of callback functor (not a C-style function pointer in libevent)
* Non-blocking pure asynchronous Multithreaded TCP server/client
* Non-blocking pure asynchronous multithreaded HTTP Server/client
* Non-blocking pure asynchronous multithreaded UDP server
* Support multi-process mode
* Excellent cross-platform features and high performance (inherited from the advantages of libevent)



The EVPP compilation needs to rely on the following dynamic libraries, respectively, described as follows:



Libevent glog gtest gflags boost EVPP



linevent:
 1, window Access: http://libevent.org/libevent-2.0.22.tar.gz, copy to the Linux machine
  (or Linux wget http://libevent.org/libevent-2.0.22.tar.gz)
 2, tar-zxvf libevent-2.0.22-stable.tzr.gz
 3, cd libevent-2.0.22-stable
 4,./ Configure--PREFIX=/USR
 5, make
 6, sudo make install
 7, Check if the installation is successful, Ls-al/usr/lib | grep libevent  
 


Glog:
1. Download Source: Git clone https://github.com/google/glog
(git clone download Slow can be consulted:
on Ubuntu to fix the slow way to access GitHub:
1, enter the terminal command line mode, input sudo vi/etc/hosts
2, input I enter the editing command, English input method input G,vim editor jumps to the last line of the Hosts file
3. Access ipaddress.com using the IP Lookup tool to obtain the IP address of the github.com and github.global.ssl.fastly.net domain names with the browser
4. In the vi open Hosts file, add the following format:
192.30.253.112 github.com
151.101.44.249 github.global.ssl.fastly.net
5. ESC exit Edit mode, enter: Wq, save Hosts file, modify hosts end
6. Update the DNS cache, enter sudo/etc/init.d/networking restart
 )
2. Configuration: sudo apt-get install autoconf automake libtool
3. Compile and install:
Enter the source root directory (Glog folder)
./autogen.sh
./configure
make-j
sudo make install
 


gflags:
 1, download Source: Git clone https://github.com/gflags/gflags
 2, compiled installation:
   Enter the source directory (that is, the GFlags folder)
  cmake.
  make-j
  sudo make install  
 



gtest:
 1, installation Source: sudo apt-get install libgtest-dev
 2, compiling source code:
  cd/usr/src/gtest
  $ sudo mkdir build
  $ CD build
  $ sudo cmake:
  $ sudo make
 3, copy-generated libraries to the system directory (the generated libgtest.a and Libgtest_main.a are copied to the system's Lib path.) :
  $ sudo cp libgtest*.a/usr/local/lib
 


Boost:
install directly with Apt-get: sudo apt-get install Libboost-dev
(this installation succeeded, but the use failed, should be the package is not complete, no boost_system and boost_thread, etc.)
  
1, download the installation package source code:
https://www.boost.org/users/download/
2, unzip the compilation:
TAR-ZXVF boost_1_67_0.tar.gz
CD Boost_1_67_0
./bootstrap.sh (Do not add--prefix=dir, will be installed by default to/usr/local/directory, a successful B2 executable will be generated)
  
sudo./b2 Install (time is longer, 20 minutes)
 

EVPP:
1, download source code and sub-module source code:
$ cd EVPP
$ git submodule update--init--recursive
2, compile the source code:
$ mkdir-p Build && CD Build
$ cmake-dcmake_build_type=debug..
$ make-j (no parallel compilation required, direct make is good, I use make-j when the virtual machine hangs two times)
3. Running use case:
$ make test (this will run UnitTest use case, takes 3-5 minutes)
$ cd Evpp/build/bin
* Run A HTTP client example:
  

$./example_http_client_request01
warning:logging before Initgooglelogging () is written to STDERR
I0306 11:45:09.464159 13230 inner_pre.cc:37] Ignore sigpipe
I0306 11:45:09.464896 13230 client01.cc:30] Do HTTP request
I0306 11:45:09.493073 13231 client01.cc:14] http_code=200 [OK]
I0306 11:45:09.493124 13231 client01.cc:16] HTTP HEADER Connection=close
I0306 11:45:09.493242 13231 event_loop.cc:103] EventLoop is stopping now, tid=140722561709824
I0306 11:45:09.993921 13231 event_loop.cc:93] EventLoop stopped, tid:140722561709824
I0306 11:45:09.994107 13230 client01.cc:38] Eventloopthread stopped.


  *** Run a HTTP server example:
   $./example_httpecho
  warning:logging before Initgooglelogging () is written to STDERR
  i0306 12:15:31.703927 21228 inner_pre.cc:37] Ignore sigpipe
  i0306 12:15:31.706221 21228 http_server.cc:99] HTTP server is running
  *** and in another console (to impersonate the client when the server is running):
   $ curl" Http://127.0.0.1:9009/echo "-D" Hello, World "
  Ello, World



*run a TCP echo Server example:
$./example_tcpecho
* and in another console (impersonate the client to run on the server):
$ telnet 127.0.0.1 9099
Trying 127.0.0.1 ...
Connected to 127.0.0.1.
Escape character is ' ^] '.



Ubuntu Virtual Machine Installation EVPP Open Source Library description


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.