Giter Site home page Giter Site logo

kcenon / messaging_system Goto Github PK

View Code? Open in Web Editor NEW
31.0 1.0 1.0 1.11 MB

Asynchronous TCP communication system in order to support micro-service architecture.

License: Other

C++ 95.29% CMake 1.54% Shell 0.30% Batchfile 0.07% Python 2.80%
tcp tcp-server tcp-client message-passing threadpool priority-queue logging microservices asynchronous cpp17

messaging_system's Introduction

CodeFactor Codacy Badge

What is

Normally, it is pretty hard to implement a TCP server and client with a proper thread system in the C++ language. To support newbie's desire to make their own TCP communication system, I planned its project.

So, it will contain several systems like below,

  1. File log system
  2. Concurrency control by the thread pool system
  3. Serializable data packet container
  4. Asynchronous multi-session TCP server
  5. Asynchronous TCP Client

And, it will provide functions like below,

  1. Callback functions for each sequence such as connection, receiving data and receiving file
  2. Send packet to specific target client
  3. Send packet to all connected clients
  4. Send files between main server and middle server
  5. Packet compress and encrypt

How to build

Before building this project, you have to download and build vcpkg. Secondly, should install libraries like below followed vcpkg install rule,

  1. asio library: to support network implement
  2. fmt library: to support string formatting
  3. cryptopp library: to support data encryption
  4. lz4 library: to support data compression
  5. crossguid library: to support creating guid
  6. cpprestsdk library: to support REST-API server & client

After all installations, you can build this project on Both Linux and Windows

How to use

To understand how to use this library, it provided several sample programs on the samples folder.

  1. logging_sample: implemented how to use logging
  2. container_sample: implemented how to use data container
  3. threads_sample: implemented how to use priority thread with job or callback function
  4. echo_server: implemented how to use network library for creating an echo server
  5. echo_client: implemented how to use network library for creating an echo client
  6. download_sample: implemented how to use file download via provided micro-server on the micro-services folder
  7. upload_sample: implemented how to use file upload via provided micro-server on the micro-services folder
  8. restapi_client_sample: implemented how to use REST-API via provided micro-server on the micro-services folder

License

Note: This license has also been called the "New BSD License" or "Modified BSD License". See also the 2-clause BSD License.

Copyright 2021 ๐Ÿ€โ˜€๐ŸŒ•๐ŸŒฅ ๐ŸŒŠ

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contact

Please report issues or questions here: https://github.com/kcenon/messaging_system/issues

messaging_system's People

Contributors

kcenon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mirikakang

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.