Skip to content

sachinsaini4278/UDP-RECEIVER-WITH-LOGGING

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UDP Unicast Receiver with Nanolog Logging

Use application directly with any setup

You can directly use the application without building it. Use files that are inside bin directory.
i.e.
  • UDP_LISTENER
  • udp-listener.conf
  • logs folder(if you want file logging inside logs folder)
  • .
    Modify udp-listener.conf according to your use.
    I have added all about configuration below point number 3.
    If want to build it then follow steps:

    1. Environment Setup


    Application is for Linux so would be covering environment setup for the same.

    We just need the following to get started: I have build config reader using boost. To build it you need to install boost library.

  • C++ compiler (preferably g++)

  • Text-editor

  • cmake

  • boost.asio

  • If cmake is not installed in your linux system, Then install using following command: ``` sudo apt-get install cmake ```
    The simplest way to get asio on linux is by executing the following command:
    ``` sudo apt-get install libboost-all-dev ```
    If you’re using some other platform or the above doesn’t seem a good fit for you, follow the document [here](http://think-async.com/Asio/asio-1.10.6/doc/asio/using.html) to get asio on your system.

    The next step is to make sure you have C++ compiler on your compiler. Either gcc or g++. You can get the same with the following command in linux.

    sudo apt-get install gcc 
    

    or

    sudo apt-get install g++ 
    

    Once you have the compiler, you’re good to follow along. I am using visual studio code as a text editor. You can choose one of your choice.

    2. How to build this application

    I have added command in CMakeLists.txt to build cmake. To build CMake in release mode run following command: ``` cmake -DCMAKE_BUILD_TYPE=Release ```
    DEBUG for dev debugging : ``` cmake -DCMAKE_BUILD_TYPE=Debug ```

    Note: While building CMake, You should in working directory where your CMakeLists.txt is. Once you have successfully build cmake then a make file is generated. Now you have to run make command to compile your application.

    Application will be generated in bin directory as we have set in CMakeLists.txt.

    3. About Configuration

    There should be a conf file where your application is. Config file name should be udp-listener.conf as we are accessing file using same name. In config there are some fields I have added:
    1. SERVER-IP=127.0.0.1

    2. SERVER-PORT=9090

    3. CONSOLE-LOGGING=true

    4. FILE-LOGGING=false

    5. LOGS-LOCATION=./logs

    1. SERVER-IP: IP of server from where you are trying to receive data.
    2. SERVER-PORT: PORT of server from where you are trying to receive data.
    3. CONSOLE-LOGGING: It should true if you want to see the receiving data on console, otherwise false.
    4. FILE-LOGGING: It should true if you want to write the receiving data in log file, otherwise false.
    5. LOGS-LOCATION: location of folder where you want to generate log file. Leave blank if you want in same directory where you application is. In the above example logs will be created inside logs folder.

    About

    UDP receiver in C++ with NANOLOG logging. Set IP, Port and other configuration in config file.

    Resources

    License

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published