Giter VIP home page Giter VIP logo

Overview

LibProNet(https://github.com/libpronet/libpronet) is a network communication engine in c++. It is composed of a network library, a messaging framework as well as a toolset.

LibProNet is designed to be a reliable, easy-to-use and cross-platform solution, which is object-oriented and has a layered structure.

LibProNet has 3 parts: a basic toolset, a network abstract layer and an application layer.

The toolset layer provides some commonly used utilities in a network communication application, including threads, tasks, locks, timers, memory pool etc.

The network abstract layer encapsulates the socket I/O model and abstracts a communication as a set of objects, such as reactor, transporter, receiver, connector, handshaker, SSL/TLS objects, and the sharing socket.

The application layer, incorporating the encapsulation of the RTP protocol and sorts of RTP sessions, is an infrastructure of real-time messaging.

LibProNet is capable of handling millions of concurrent connections with ease, qualifying as a underlying communication engine of a large service cluster system, a multimedia communication system or a messaging system.

Please refer to "pro_net.h", "rtp_base.h", and "rtp_msg.h" under the directory of "pub/inc/pronet" for more.

     ______________________________________________________
    |         |                                  |         |
    |         |              ProRtp              |         |
    |         |__________________________________|         |
    |                                   |                  |
    |               ProNet              |                  |
    |___________________________________|                  |
    |                    |                     ProUtil     |
    |                    |                                 |
    |                    |_________________________________|
    |      MbedTLS                 |                       |
    |                              |       ProShared       |
    |______________________________|_______________________|
                 Fig.1 module hierarchy diagram

     ________________   ________________   ________________
    |    Acceptor    | |   Connector    | |   Handshaker   |
    | (EventHandler) | | (EventHandler) | | (EventHandler) |
    |________________| |________________| |________________|
             A                  A                  A
             |       ...        |       ...        |
     ________|__________________|__________________|_______
    |                       Reactor                        |
    |   ____________     _____________     _____________   |
    |  A            |   A             |   A             |  |
    |  |     Acc    |   |     I/O     |   |   General   |  |
    |  |   NetTask  |   |   NetTask   |   |  TimerTask  |  |
    |  |____________V   |_____________V   |_____________V  |
    |                                                      |
    |   ____________     _____________     _____________   |
    |  A            |   A             |   A             |  |
    |  |    I/O     |   |     I/O     |   |     MM      |  |
    |  |   NetTask  |   |   NetTask   |   |  TimerTask  |  |
    |  |____________V   |_____________V   |_____________V  |
    |                                                      |
    |       ...               ...               ...        |
    |______________________________________________________|
             |                  |                  |
             |       ...        |       ...        |
     ________V_______   ________V_______   ________V_______
    |   Transport    | |   ServiceHub   | |  ServiceHost   |
    | (EventHandler) | | (EventHandler) | | (EventHandler) |
    |________________| |________________| |________________|
               Fig.2 structure diagram of Reactor

    __________________                     _________________
   |    ServiceHub    |<----------------->|   ServiceHost   |
   |   ____________   |    ServicePipe    |(Acceptor Shadow)| Audio-Process
   |  |            |  |                   |_________________|
   |  |  Acceptor  |  |        ...         _________________
   |  |____________|  |                   |   ServiceHost   |
   |                  |    ServicePipe    |(Acceptor Shadow)| Video-Process
   |__________________|<----------------->|_________________|
        Hub-Process
            Fig.3-1 structure diagram of ServiceHub

    __________________                     _________________
   |    ServiceHub    |<----------------->|   RtpService    |
   |   ____________   |    ServicePipe    |(Acceptor Shadow)| Audio-Process
   |  |            |  |                   |_________________|
   |  |  Acceptor  |  |        ...         _________________
   |  |____________|  |                   |   RtpService    |
   |                  |    ServicePipe    |(Acceptor Shadow)| Video-Process
   |__________________|<----------------->|_________________|
        Hub-Process
            Fig.3-2 structure diagram of RtpService

            ______________________________
    ====>>in__________ o                  |__________
                      | o                  __________out====>>
                      |..ooooooooooooooooo|       A
                      |ooooooooooooooooooo|       |
                      |ooooooooooooooooooo| WallHeight is 5
                      |ooooooooooooooooooo|       |
                      |ooooooooooooooooooo|       V
             Fig.4 structure diagram of RtpReorder

     ______________________________________________________
    |                                                      |
    |                      msg server                      |
    |______________________________________________________|
             |             |        |              |
             | ...         |        |          ... |
     ________|_______      |        |      ________|_______
    |                |     |        |     |                |
    |     msg c2s    |     |        |     |     msg c2s    |
    |________________|     |        |     |________________|
        |        |         |        |         |        |
        |  ...   |         |  ...   |         |  ...   |
     ___|___  ___|___   ___|___  ___|___   ___|___  ___|___
    |  msg  ||  msg  | |  msg  ||  msg  | |  msg  ||  msg  |
    | client|| client| | client|| client| | client|| client|
    |_______||_______| |_______||_______| |_______||_______|
             Fig.5 structure diagram of msg system

How to compile LibProNet?

In some cases, you may need to define some macros. Please refer to the file "build/DEFINE.txt" for more.

  1. GCC on Linux

    To build the libraries you will need to have autoconf-2.63+ and automake-1.11+ installed appropriately in your system.

    On Ubuntu:

    apt-get install autoconf automake gcc g++ make

    On CentOS:

    yum install autoconf automake gcc gcc-c++ make

    cd build/linux-gcc-r/x86_64 (or "cd build/linux-gcc-r/x86")

    ./autogen.sh

    make

    make install

  2. VS2015 on Windows

    The solution file is "build/windows-vs2015/pronet.sln"

  3. Qt Creator on Windows

    Open the project file "build/windows-qt-gcc/mbedtls/mbedtls.pro"

    Open the project file "build/windows-qt-gcc/pro_util/pro_util.pro"

  4. Android NDK on Windows

    Run the script "build/android-clang-r/rebuil-all.bat"

  5. Xcode on Mac OS X

    You will need to create project files manually.

How to run the messaging system on Linux?

By default, the installation location is "/usr/local/libpronet", which we call "${install}".

  1. Execute the scripts "${install}/bin/set1_sys.sh" and "${install}/bin/set2_proc.sh" in the current shell

    cd ${install}/bin

    . ./set1_sys.sh

    . ./set2_proc.sh

  2. Adjust the config file "${install}/bin/pro_service_hub.cfg", and start a "${install}/bin/pro_service_hub" process

    ./pro_service_hub

  3. Adjust the config file "${install}/bin/rtp_msg_server.cfg", and start a "${install}/bin/rtp_msg_server" process

    ./rtp_msg_server

  4. Adjust the config file "${install}/bin/test_msg_client.cfg", and start some "${install}/bin/test_msg_client" processes

    ./test_msg_client

How to run the tests on Linux?

By default, the installation location is "/usr/local/libpronet", which we call "${install}".

  1. Execute the scripts "${install}/bin/set1_sys.sh" and "${install}/bin/set2_proc.sh" in the current shell

    cd ${install}/bin

    . ./set1_sys.sh

    . ./set2_proc.sh

  2. Adjust the config file "${install}/bin/test_tcp_server.cfg", and start a "${install}/bin/test_tcp_server" process

    ./test_tcp_server

  3. Adjust the config file "${install}/bin/test_tcp_client.cfg", and start some "${install}/bin/test_tcp_client" processes

    ./test_tcp_client or ./test_tcp_client <server_ip> <server_port> or ./test_tcp_client <server_ip> <server_port> <local_ip>

How to run the messaging system on Windows(64bit)?

  1. Run the script "pub/lib-r/_get-win-vs2015.bat", and run the script "pub_test/_get-vs2015-x86_64-r.bat"

  2. Adjust the config file "pub_test/vs2015-x86_64-r/pro_service_hub.cfg", and start a "pub_test/vs2015-x86_64-r/pro_service_hub.exe" process

    cd pub_test\vs2015-x86_64-r

    pro_service_hub

  3. Adjust the config file "pub_test/vs2015-x86_64-r/rtp_msg_server.cfg", and start a "pub_test/vs2015-x86_64-r/rtp_msg_server.exe" process

    rtp_msg_server

  4. Adjust the config file "pub_test/vs2015-x86_64-r/test_msg_client.cfg", and start some "pub_test/vs2015-x86_64-r/test_msg_client.exe" processes

    test_msg_client

How to run the tests on Windows(64bit)?

  1. Run the script "pub/lib-r/_get-win-vs2015.bat", and run the script "pub_test/_get-vs2015-x86_64-r.bat"

  2. Adjust the config file "pub_test/vs2015-x86_64-r/test_tcp_server.cfg", and start a "pub_test/vs2015-x86_64-r/test_tcp_server.exe" process

    cd pub_test\vs2015-x86_64-r

    test_tcp_server

  3. Adjust the config file "pub_test/vs2015-x86_64-r/test_tcp_client.cfg", and start some "pub_test/vs2015-x86_64-r/test_tcp_client.exe" processes

    test_tcp_client or test_tcp_client <server_ip> <server_port> or test_tcp_client <server_ip> <server_port> <local_ip>

Eric Tung's Projects

dependencies icon dependencies

A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.

h264bitstream icon h264bitstream

A complete set of functions to read and write H.264 video bitstreams, in particular to examine or modify headers.

libpromsg icon libpromsg

A wrapper for the LibProNet messaging system. (C++/JNI/Java)

libpronet icon libpronet

LibProNet is a network communication engine in c++.

libprorpc icon libprorpc

An asynchronous RPC library based on the LibProMsg.

mbedtls icon mbedtls

An open source, portable, easy to use, readable and flexible SSL library

poco icon poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.

protobuf icon protobuf

Protocol Buffers - Google's data interchange format

url_encoder icon url_encoder

C++ implementation of URL encoding (http://tools.ietf.org/html/rfc3986)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.