Giter Club home page Giter Club logo

aregtech / areg-sdk Goto Github PK

View Code? Open in Web Editor NEW
244.0 7.0 109.0 22.83 MB

AREG is an asynchronous Object RPC framework to simplify multitasking programming by blurring borders between processes and treating remote objects as if they coexist in the same thread.

Home Page: https://www.aregtech.com

License: Apache License 2.0

C++ 96.85% C 1.64% Batchfile 0.07% Shell 0.03% CMake 1.41%
iot realtime embedded rpc ipc multiprocessing concurrency distributed framework sdk

areg-sdk's Introduction

Hello and welcome! ๐Ÿ‘‹

Some brief information about myself:

  • ๐Ÿ‘จโ€๐Ÿ’ป I am a developer and entrepreneur with a passion for C/C++. As well develop with C# and Java.
  • ๐Ÿ‘€ My interests lie in exploring and experimenting with technologies in robotics, embedded systems, and IoT edge.
  • ๐Ÿš€ In my free time, I have devoted myself to developing the open source AREG SDK with enthusiasm.

The AREG SDK is an innovative development platform equipped with a lightweight and intelligent communication engine, and comprehensive set of tools to build complex interactive systems at the edge of IoT networks. As a regular conference speaker, I have showcased the capabilities of AREG SDK. Check out the AREG IoT SDK whitepaper, which focuses on IoT edge-centric and distributed solutions for embedded applications, prepared for the embedded world Exhibition&Conference global platform for the embedded community. I am confident that the AREG SDK will be a valuable solution for developers and businesses.

I welcome C/C++ developers to join in further development of the AREG engine. I also invite C# developers to contribute to the cross-platform AREG SDK GUI tool development.

AREG SDK is a project that I have poured my heart into. Try it out and please leave a rating โญ


Join in social media: Follow us on twitter ย  Follow us on LinkedIn

Repo status

areg-sdk's People

Contributors

ali-nasrolahi avatar aregtech avatar biwiki avatar github-actions[bot] avatar gitter-badger avatar pybaker avatar vukihub 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

areg-sdk's Issues

Wrong import and export flags of areg library

Precondition
Merged the latest code and cmake changes (issue #28) in the 20220701-candidate branch to make a build.

Actions
Make a build using CMake

Expected
Compilation with no warnings and errors.

Result
When compile examples, see the warning message:
WARNING: None of preprocessor defines are set. By default sets EXP_AREG_DLL. See GESwitches.h file of AREG API Core
This may happen only when none of these options is set: EXP_AREG_DLL, EXP_AREG_LIB, IMP_AREG_DLL, IMP_AREG_LIB

Note:

  1. When compile areg-sdk frameworklibrary as shared library (areg.so / areg.dll) the flag must be EXP_AREG_DLL, all other modules must have flag IMP_AREG_DLL
  2. When compile areg-sdk frameworklibrary as static library (areg.a / areg.lib*) the flag must be EXP_AREG_LIB, all other modules must have flag IMP_AREG_LIB

Only in these cases there will be no warning. Otherwise, there will be a problem compiling for Windows OS, which requires precise import / export flags.

Application may crash on exit

Describe the bug
In the example 13, when applications receive notification to exit, they may crash with the exception. The reason is generating response event of non exiting Proxy. In the current implementation there is a quick work around to lock the resources when generate response event.
See and track lockProxyResource() and unlockProxyResource() methods in ProxyBase class. The methods are used in RemoteEventFactory class (line 113).

Hint to fix
Use shared pointers in the resource map of ProxyBase class to avoid using a pointers of non existing objects. Pay attention on performance and optimization.

Implement UDP/IP wrapper objects.

Implement support of UDP/IP communication channel, integrate in communication manager.
Goal:

  • Currently AREG SDK supports TCP/IP protocol and it should support as well UDP.
  • The protocol configuration is defined in file router.init

Motivaton:

  • As an alternative to TCP/IP and as a fast communication, AREG SDK should support UDP.
  • There will be a new example of testing data rate by switching between protocols, developers may make test protocols and choose one, which is more suitable for their projects.

Background information:

When the objects are ready, there will be refactoring of IPC, so that depending of configuration the application will decide whether to use TCP/IP or UDP channels.

Release 1.5 preparation

There are many minor changes to make to prepare release 1.5.
This task does not have concrete feature to implement. It is created to make notes for small changes to release areg-sdk 1.5.

Examples failed to compile with VSCode and GCC compiler

Describe the bug
Try to compile codes in VSCode and GCC compiler of 20220701-candidate branch. All projects, except projects 10_locsvc and 11_locmesh are compiled and linked. The mentioned 2 projects failed during linking.

To Reproduce
Steps to reproduce the behavior.

  • In VSCode select CMakeLists.txt of the root folder and configure.
  • After configuration, build all projects.

Expected behavior
All projects must be compiled and linked.

Desktop or embedded (please complete the following information):

  • OS: Windows 10
  • Hardware 64_x86
  • Compiler cygwin-gcc
  • AREG SDK version: 20220701-candidate branch.

Additional context
There were more projects that were not compiling, fixed by linking with libraries.
Also tried to compile projects with MS Visual Studio CMake tool, all projects compiled fine.

Extend unit tests

Problem
The demonstration of features are in the example folder of AREG SDK. But still there are many objects and many methods that are never tested. In order to test, there is a need to increase amount of unit tests.

Actions
The unit tests are integrated and should be implemented in the tests/units. Each .cpp file should contain one test name. The tests are added in the CMakeFiles.txt by calling addTest() method, which automatically includes the tests in the compilation. The testing module is the AREG engine / framework.

Note
This ticket cannot be assigned to one person since the topic of unit tests is huge.
Please inform for which object / topic you want to create unit test and I'll create a separate ticket and branch, and assign to you.

Extend workflows to check compilations

Problem
When merging pull requests, sometimes they break compilation under different platforms and tools. To check the compilation, GitHub allows to create workflows and compile codes. In the current implementation there are workflows to check compilation:

  • cmake and gcc compiler under Linux (Ubuntu)
  • 'make' and 'gcc' compiler under Linux (Ubuntu),
  • MSBuild, which uses .sln file (MS Visual Studio solution file) and compiles by MSVC compiler for Windows.

Solution
In order to check the builds, the existing workflow(s) should be modified, that by using CMake tool to check:

  1. Compilation under Windows use compilers g++ / gcc and 'MSVC`, Release and Debug build types
  2. Compilation under Linux use compilers g++/ gcc and clang, Release and Debug build types.
  3. Run Google Tests after compilation

Note:
The codes are written using C++17, the selected compilers must use specified versions.

Improve streaming data rate

Goal
The example 20_pubdatarate (currently available in candidate branch) shows that the communication data rate is about 100-120 MB/s on the PC. This value should be increased to achieve at least 300 MB/s on the PC.

Motivation
AREG SDK should handle high data rate without a problem (the minimum data rate on PC should be 300 MB/s). In most of the cases, the data rate should be dependent on CPU / HW, and less dependent on the code implementation. Currently nearly half of delay is because of the code. In the current implementation we serialize data in streaming object then copy data in the message. The creating event object for each target, copying data in the message, applying CRC cause delays.

Background information
The events are instantiated for each client. Currently the data is serialized in the shared buffer, but then they are copied to each message.
Analyze the possibility:

  • check presence of the event listeners before starting serialization. Escape serialization if none is present.
  • create an event only once for all targets. Instead, set the list of targets sorted by channels.
  • the list should be handled by mcrouter, so that the source sends an event one time.

The current business logic serializes data in the shared buffer then copied in the message.

  • analyze the possibility to unify messages (unify protocol) for IPC and local targets.
  • make message generic and independent on target location / channel.
  • Pay attention on mechanism of applying CRC. Maybe apply the CRC only on data and escape target / source.

Test changes using 20_pubdatarate

Refactor for MSVC

In order to integrate areg-sdk in the areg-sdk-demo to compile with MSVC, there is need to refactor to be able to set the areg-sdk root and output directories. The current settings in property files uses the SolutionDir, which causes problem.
Refactor areg-sdk, so that it can be easily integrated in any project to compile projects using MSVC.

The compilation with cygwin is broken

Description

After googletest integration the cygwin compilation with enabled test is broken.
This behavior observed in Windows platform

To Reproduce

Steps to reproduce the behavior.

Preconditions:

  1. This behavior is observed in the Windows OS.
  2. You should have installed cygwin and at least the GCC compilers (gcc and g++)
  3. Make sure that at least the path cygwin/bin is included in environment variable PATH that g++ can be called from command line.
  4. You should have MS Visual Studio or Visual Studio Code installed in your machine

Action sSteps to reproduce:

  1. Open the project in VS Code or in MSVS
  2. In the CMakeLists.txt of areg-sdk make sure that compilation of tests is enabled: option(BUILD_TESTS "Build unit tests" ON)
  3. In the conf/cmake/user.cmake file make sure that the GCC compilers are selected: set(CMAKE_CXX_COMPILER "g++")
  4. In the IDE select CMakeLists.txt in the root folder of areg-sdk, configure the projects and build.

Result
All projects are compiled. When start compiling tests, it fails with errors.
Here are logs:

[379/389] Building CXX object CMakeFiles/demo_test.dir/tests/units/DemoTest.cpp.obj
  In file included from E:/Projects/aregtech/areg-sdk/framework/areg/base/GEGlobal.h:58,
                   from E:/Projects/aregtech/areg-sdk/tests/units/DemoTest.cpp:2:
  E:/Projects/aregtech/areg-sdk/framework/areg/base/GESwitches.h:131:139: note: '#pragma message: WARNING: None of preprocessor defines are set. By default sets EXP_AREG_DLL. See GESwitches.h file of AREG API Core'
    131 |     #pragma message ("WARNING: None of preprocessor defines are set. By default sets EXP_AREG_DLL. See GESwitches.h file of AREG API Core")
        |                                                                                                                                           ^
  [380/389] Building CXX object thirdparty/googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.obj
  FAILED: thirdparty/googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.obj 
  D:\cygwin64\bin\g++.exe -DDEBUG -DPOSIX -DUNICODE -IE:/Projects/aregtech/areg-sdk/framework -IE:/Projects/aregtech/areg-sdk/thirdparty -IE:/Projects/aregtech/areg-sdk/examples/13_pubmesh -IE:/Projects/aregtech/areg-sdk/examples/08_service -IE:/Projects/aregtech/areg-sdk/examples/09_svcmulti -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest -IE:/Projects/aregtech/areg-sdk/tests -IE:/Projects/aregtech/areg-sdk/tests/units -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest -g -Wall -Wshadow -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=0 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O0 -g3 -pthread -Wall -c -std=c++17 -fmessage-length=0 -MMD -DENABLE_TRACES -m64 -std=c++17 -MD -MT thirdparty/googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.obj -MF thirdparty\googletest\googletest\CMakeFiles\gtest_main.dir\src\gtest_main.cc.obj.d -o thirdparty/googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.obj -c E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/src/gtest_main.cc
  In file included from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/gtest-message.h:55,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/gtest-assertion-result.h:46,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/gtest.h:60,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/src/gtest_main.cc:32:
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'int testing::internal::posix::FileNo(FILE*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(1999,40): error GCDAC0D3F: 'fileno' was not declared in this scope; did you mean 'FileNo'?
   1999 | inline int FileNo(FILE* file) { return fileno(file); }
        |                                        ^~~~~~
        |                                        FileNo
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'char* testing::internal::posix::StrDup(const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2049,47): error GF304C94A: 'strdup' was not declared in this scope; did you mean 'StrDup'?
   2049 | inline char* StrDup(const char* src) { return strdup(src); }
        |                                               ^~~~~~
        |                                               StrDup
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'FILE* testing::internal::posix::FDOpen(int, const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2092,56): error GEDCCDFA4: 'fdopen' was not declared in this scope; did you mean 'fopen'?
   2092 | inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
        |                                                        ^~~~~~
        |                                                        fopen
  [381/389] Linking CXX executable E:\Projects\aregtech\areg-sdk\product\build\gnu\windows-x86_64-debug\bin\09_svcmulti.exe
  [382/389] Building CXX object thirdparty/googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.obj
  FAILED: thirdparty/googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.obj 
  D:\cygwin64\bin\g++.exe -DDEBUG -DPOSIX -DUNICODE -IE:/Projects/aregtech/areg-sdk/framework -IE:/Projects/aregtech/areg-sdk/thirdparty -IE:/Projects/aregtech/areg-sdk/examples/13_pubmesh -IE:/Projects/aregtech/areg-sdk/examples/08_service -IE:/Projects/aregtech/areg-sdk/examples/09_svcmulti -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest -IE:/Projects/aregtech/areg-sdk/tests -IE:/Projects/aregtech/areg-sdk/tests/units -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest -g -Wall -Wshadow -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=0 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O0 -g3 -pthread -Wall -c -std=c++17 -fmessage-length=0 -MMD -DENABLE_TRACES -m64 -std=c++17 -MD -MT thirdparty/googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.obj -MF thirdparty\googletest\googlemock\CMakeFiles\gmock_main.dir\src\gmock_main.cc.obj.d -o thirdparty/googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.obj -c E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/src/gmock_main.cc
  In file included from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/internal/gmock-port.h:57,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:49,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/gmock-actions.h:145,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/gmock.h:56,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/src/gmock_main.cc:32:
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'int testing::internal::posix::FileNo(FILE*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(1999,40): error GCDAC0D3F: 'fileno' was not declared in this scope; did you mean 'FileNo'?
   1999 | inline int FileNo(FILE* file) { return fileno(file); }
        |                                        ^~~~~~
        |                                        FileNo
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'char* testing::internal::posix::StrDup(const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2049,47): error GF304C94A: 'strdup' was not declared in this scope; did you mean 'StrDup'?
   2049 | inline char* StrDup(const char* src) { return strdup(src); }
        |                                               ^~~~~~
        |                                               StrDup
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'FILE* testing::internal::posix::FDOpen(int, const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2092,56): error GEDCCDFA4: 'fdopen' was not declared in this scope; did you mean 'fopen'?
   2092 | inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
        |                                                        ^~~~~~
        |                                                        fopen
  [383/389] Building CXX object thirdparty/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.obj
  FAILED: thirdparty/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.obj 
  D:\cygwin64\bin\g++.exe -DDEBUG -DPOSIX -DUNICODE -IE:/Projects/aregtech/areg-sdk/framework -IE:/Projects/aregtech/areg-sdk/thirdparty -IE:/Projects/aregtech/areg-sdk/examples/13_pubmesh -IE:/Projects/aregtech/areg-sdk/examples/08_service -IE:/Projects/aregtech/areg-sdk/examples/09_svcmulti -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest -IE:/Projects/aregtech/areg-sdk/tests -IE:/Projects/aregtech/areg-sdk/tests/units -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include -isystem E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest -g -Wall -Wshadow -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=0 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O0 -g3 -pthread -Wall -c -std=c++17 -fmessage-length=0 -MMD -DENABLE_TRACES -m64 -std=c++17 -MD -MT thirdparty/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.obj -MF thirdparty\googletest\googlemock\CMakeFiles\gmock.dir\src\gmock-all.cc.obj.d -o thirdparty/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.obj -c E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/src/gmock-all.cc
  In file included from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/internal/gmock-port.h:57,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:49,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/gmock-actions.h:145,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/include/gmock/gmock.h:56,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googlemock/src/gmock-all.cc:39:
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'int testing::internal::posix::FileNo(FILE*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(1999,40): error GCDAC0D3F: 'fileno' was not declared in this scope; did you mean 'FileNo'?
   1999 | inline int FileNo(FILE* file) { return fileno(file); }
        |                                        ^~~~~~
        |                                        FileNo
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'char* testing::internal::posix::StrDup(const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2049,47): error GF304C94A: 'strdup' was not declared in this scope; did you mean 'StrDup'?
   2049 | inline char* StrDup(const char* src) { return strdup(src); }
        |                                               ^~~~~~
        |                                               StrDup
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'FILE* testing::internal::posix::FDOpen(int, const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2092,56): error GEDCCDFA4: 'fdopen' was not declared in this scope; did you mean 'fopen'?
   2092 | inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
        |                                                        ^~~~~~
        |                                                        fopen
  [384/389] Building CXX object thirdparty/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj
  FAILED: thirdparty/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj 
  D:\cygwin64\bin\g++.exe -DDEBUG -DPOSIX -DUNICODE -IE:/Projects/aregtech/areg-sdk/framework -IE:/Projects/aregtech/areg-sdk/thirdparty -IE:/Projects/aregtech/areg-sdk/examples/13_pubmesh -IE:/Projects/aregtech/areg-sdk/examples/08_service -IE:/Projects/aregtech/areg-sdk/examples/09_svcmulti -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest -IE:/Projects/aregtech/areg-sdk/tests -IE:/Projects/aregtech/areg-sdk/tests/units -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include -IE:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest -g -Wall -Wshadow -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=0 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -O0 -g3 -pthread -Wall -c -std=c++17 -fmessage-length=0 -MMD -DENABLE_TRACES -m64 -std=c++17 -MD -MT thirdparty/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj -MF thirdparty\googletest\googletest\CMakeFiles\gtest.dir\src\gtest-all.cc.obj.d -o thirdparty/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj -c E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/src/gtest-all.cc
  In file included from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/gtest-message.h:55,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/gtest-assertion-result.h:46,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/gtest.h:60,
                   from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/src/gtest-all.cc:38:
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'int testing::internal::posix::FileNo(FILE*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(1999,40): error GCDAC0D3F: 'fileno' was not declared in this scope; did you mean 'FileNo'?
   1999 | inline int FileNo(FILE* file) { return fileno(file); }
        |                                        ^~~~~~
        |                                        FileNo
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'char* testing::internal::posix::StrDup(const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2049,47): error GF304C94A: 'strdup' was not declared in this scope; did you mean 'StrDup'?
   2049 | inline char* StrDup(const char* src) { return strdup(src); }
        |                                               ^~~~~~
        |                                               StrDup
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/include/gtest/internal/gtest-port.h: In function 'FILE* testing::internal::posix::FDOpen(int, const char*)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\include\gtest\internal\gtest-port.h(2092,56): error GEDCCDFA4: 'fdopen' was not declared in this scope; did you mean 'fopen'?
   2092 | inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
        |                                                        ^~~~~~
        |                                                        fopen
  In file included from E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/src/gtest-all.cc:45:
  E:/Projects/aregtech/areg-sdk/thirdparty/googletest/googletest/src/gtest-port.cc: In constructor 'testing::internal::CapturedStream::CapturedStream(int)':
E:\Projects\aregtech\areg-sdk\thirdparty\googletest\googletest\src\gtest-port.cc(1102,31): error GB3A25D75: '::mkstemp' has not been declared; did you mean 'mkdtemp'?
   1102 |     const int captured_fd = ::mkstemp(const_cast<char*>(name_template.data()));
        |                               ^~~~~~~
        |                               mkdtemp
  ninja: build stopped: subcommand failed.

Build failed.

Expected behavior

All projects should be compiled without problems.

Additional context

As a hint to fix, have a look at discussion GoogleTest 1.6 with Cygwin 1.7 compile error: 'fileno' was not declared in this scope

UDP/IP service and communication channel

Goal
After implementing the UDP/IP wrapper (issue #32), it should be integrated in the AREG SDK to support communication using UDP/IP.

Motivation
The implementation of Multiple channel communication (issue #31) will allow to use different network communication. One of the easiest and fasted way to approve multi-channel communication is integration of the UDP/IP, which in comparison to TCP/IP is faster, but less stable.

Background information
The UDP/IP should be configured in the initialization files (issue #67). After setups, the network service should be able to establish UDP/IP connection and use multi-channel communication for messaging.

Extend network configuration to setup multiple networks

Goal
At this moment, AREG SDK supports only 1 communication channel via TCP/IP communication. The supported networks configuration is defined router.init file and is relevant only for message routing. The applications should be able via configuration to setup and initialize multiple network channels and protocols. In order to setup applications, there should be possibility to define the physical (network) and logical (routing) connections. This would also help to setup multi-channel communication, where each channel differ by:

  • network
  • protocol
  • message priority

Motivation
The multi-channel communication is one of agendas of AREG SDK. Each definition of the channel should be done in the configuration file. The setups and configurations should be dynamic, so that there will be no need to re-compile applications.

Background information
AREG SDK contains a parser to parse configuration files (init files). The parser has a simple syntax used to make setups to use when application initializes objects. At this moment the configuration is used to setup logging and mcrouter (IP address, port number, etc.). The parser should be extended to make initialization to use when instantiating objects like "network service".
It makes basic dynamic setups.

Integrate CMake file

Similar to Makefile, there should be integrate CMake

  • to compile all project
  • generate files in product/gen folder
  • Add possibility to include .siml files in CMake automatically to generate sources.

Implement additional examples

Implement additional tests to demonstrate the features. For example:

  • dynamically unlocking the request and preparing response to send back to client
  • subscribing on response

Unexpected data update notification

Description
When a client "A" connects to service and subscribes on data update notification, it receives once and the next time is expected if data is update. But if another client connects and subscribes to the same data update notification, both clients receive notification on connect.

Expected: Only the client that subscribes on data update notification should receive message. And then all clients receive when data indeed is updated.

To Reproduce
In the Example 21:

  • comment this line of code
  • recompile the projects
  • start example 21 with 2 clients --> it will fail with this assertion, because on data update the client sends a request to receive new identifier.

Expected behavior
Each client on the first subscription receives data update message from the service. But then the notifications are sent only if updated. If another client connects to service and first time subscribes on data update, the other clients should not receive the notification.

[doc] Update Howto and Wiki

Update Wiki pages, make updates of Howto.md

  1. Check the preprocessor defines
  2. Check the build with make -- check the cross-compile builds.
  3. Update the build with cmake
  4. Remove build with Eclipse.

Fix broken links

After updating documentations, some links are broken. Check and fix them.

Unit Tests for strings

Motivation.
The string functions are classes are essential, which are used in many cases. It is important to have unit test and very high code coverage of these objects and methods.

Actions

  • In the unit test folder create at least one file to implement unit tests;
  • Similar to DemoTest, include the test in the CMakeLists.txt so that it will compile separate executable.
  • All test methods of unit test should be documented with short description of the test agenda.

Additional actions
If a bug is found (test failed), there should be a ticket created and the UT code should be included to demonstrate failure.

Integrate FreeRTOS API

Motivation
At the moment the sources support Win32 API, POSIX API, and the C++17 standards.
AREG SDK should support FreeRTOS platform.

Actions:
The FreeRTOS should pass following steps:

  1. Investigate the features AREG SDK can support in FreeRTOS.
  2. List the features and objects that cannot be supported in FreeRTOS, make a proposal / trigger discussion to figure out the work arrounds.
  3. Start implementation with migration of basic API.

Separate Console object from the communication engine

Agenda
The Console object, defined and implemented in the appbase of areg framework, requires ncurses library for POSIX build. Since it is not included in the Linux essentials, it makes sense to isolate the object. Considering the fact that in the future there will be more dependencies like that, the Console should be isolated in the separate areg extensions (or aregex) project, which should be compiled as a static library, so that and any other module can use objects. For example, the mcrouter uses Console for optional output of data rate. The mcrouter may run on more powerful machine like a gateway it may have Console. So that the areg shared library can be independent on ncurses and be installed on less powerful machine.

Multiple protocol support

Goal
AREG SDK should support multiple protocols to be able to communicate with various networks and devices.

Motivation
The industry is using various networks and protocols for their use. In order to be easier integrated in different networks and communicate with other devices, or seamlessly to integrate in existing solutions, AREG SDK should support multiple protocols to serialize and de-serialize data.

Background information
Each protocols means a separate network / connection, which means separate channel. Analyze and consider the possibility of serialization / deserialization in the channel. The component may use multiple channels for the communication. Depending on the channel instance, provide serialization mechanism. This as well means that the channel is responsible to instantiate an event object, which contains message buffer with the serialized data.

Remark: This feature requires some restructuring and refactoring. At this very moment the refactoring is not the highest priority. This ticket as well has multiple dependencies like multi-channel (issue #31), optimization of the event and the optimization of message creation. (issue #66).

Implement watchdog for dispatcher threads

Implement a watchdog for dispatcher threads.

  • Each thread should be able to define a watchdog timeout, the timeout should be configurable;
  • There should be possibility to cancel watchdog;
  • There should be possibility to disable watchdog for a certain treads;
  • If a thread does not response, the watchdog terminates the thread and restarts again. Restarting a thread should configurable.

Implement logging service

Goal
Currently AREG SDK already has powerful logging / tracing mechanism and currently it makes logs only in the file. The logging is configurable and the configuration is defined in the log.init file. The logging supports log scopes and priority, which can be dynamically changed during runtime. But at the moment there is no mechanism to send message to set scopes.

Similar to mcrouter, there should be a separate process (logging service) to run on any machine that is able to collect the logs and communicate with the applications via messages (predefined protocol). The logging service should also forward logs to the log viewer (planned to develop).

In order to make these achievements there is a need to define communication messages (communication protocol) between the service and applications, which is able:

  • receive process / application name
  • request the list of scopes, activation status and log priority
  • forward logs to the log viewer
  • save logs in a readable format in the file.
  • send commands to the application such as:
    • change active status and log priority of the scope;
    • change logging configuration (including service IP / port nr.)
    • save current configuration in the config file (log.init).

Every application should be able to save configuration in the config file, so that can use on next start.

  • Send logs to log viewer (planned to develop)

Motivation
Logging is a powerful feature and tool. Sometimes debugging an application to analyze bug behavior is not always effective. For example, if a bug is related with the timing, it would be very difficult and sometimes impossible to find the bug. In such situations the logging is irreplaceable and very helpful tool.

Background information
AREG SDK already has logging (see module trace), which makes many jobs such as

  • dynamic change of priority
  • read, parse and save logging config in log.init file.
    The missing part is the logging service and bidirectional communication with the service. The implementation of the mcrouter can be a good example of developing service that uses network communication.

logger project setup

This is a subtask of issue #26

Description:
To start a logging service, named logger, we need to setup a project with minimum requirement to start a process.

Qt creator / VSCode project

AREG SDK has project files to compile with MSVC and Eclipse. Create Qt Creators project files, setup VSCode workspace to compile projects with these IDE.

Copy config files after compilation

Motivation

  1. After compilation, the developer should be able to start any project without additional effort. At this moment, to start IPC project or to configure logging, after compilation with cmake, the developer needs manually create config subdirectory and copy log.init and router.init files in the folder of binaries. For example, compiling with msvc and make automatically do this action.
  2. make under Linux compiles and creates binaries with extension .out and msvc compiles binaries with extension .exe.
  3. Both, make and msvc compile with incremental build, which is much faster and does not require to recompile all projects.

What to do

  1. After compilation of binaries with cmake, create config subfolder in the binary output folder bin (i.e. in bin/config) if it is not existing, and copy files log.init used by logging and router.init used for IPC.
  2. When compile under Linux, add .out extension to executable binaries, i.e. the mcrouter is mcrouter.out. No need to make this change for Windows, because the compiler automatically adds extension .exe.
  3. Support incremental build with cmake at least for Debug configuration, so that there will be no need to rebuild all projects after each small change.

Update documentation

In order to prepare the next release there is a need:

  1. Update existing documents.
  2. Update copyrights.
  3. Prepare release notes.

Compile MFC project with CMake

Problem
The example 17 is based on Microsoft MFC and compiled only using Microsoft Visual Studio solution file areg-sdk.sln. In all other cases as a Windows GUI desktop applications it is excluded from the builds.
Since the CMake supports compilation MFC based projects, it should be included in the CMake builds.

Solution
Include MFC project in the CMake build and pay attention on followings:

  1. The CMake has special flags supporting MFC. There are:
add_definitions(-D_AFXDLL)
set(CMAKE_MFC_FLAG 2)

where CMAKE_MFC_FLAG = 2 means compile project with shared library.

  1. There could be problems related with resource files (.rc, .rc2, .ico, etc). These 2 articles could be potential solutions:

Notes:
The example 17 should be compiled only in builds for Windows. The first priority is when build with msvc. For other compilers it can be omitted.

Make areg-sdk possible to integrate in another project

Is your feature request related to a problem? Please describe.
As any other project, areg-sdk should be possible to integrate in any existing project. Similar to gtest.
Make sure that at least it is possible to compile with the cmake

Describe the solution you'd like
Create a demo project and integrate areg-sdk as a thirdparty project / library in that.

Isolate and rename OS specific methods.

Goal

  • Make code more readable.
  • All OS specific methods should be declared as private and have prefix _os.
  • If a regular method has OS specific code, declare a method with identical name and prefix _os, replace OS specific code there.
  • All OS specific methods should be located in the OS specific files, where suffix indicates the OS API (like Win32 or Posix).
  • The exceptions are object that completely belong to a specific OS. For example, there is a class MutexIX, which is completely belong to POSIX. In this case there is no need neither to specify the Posix suffix, nor methods having prefix _os.
  • The other exceptions can be when the OS specific code is very small and can be managed with #ifdef directive like this:
AREG_API_IMPL bool NESocket::disableReceive(SOCKETHANDLE hSocket)
{
#ifdef WINDOWS
    int flag{ SD_RECEIVE };
#else
    int flag{ SHUT_RD };
#endif // WINDOWS

    return (hSocket != NESocket::InvalidSocketHandle ? RETURNED_OK == ::shutdown(hSocket, flag) : false);
}

Motivation
This is a good preparation for future to integrate and support multiple OS. It clearly shows what are the OS dependent API.

Background information
At the moment, AREG SDK supports Win32 and POSIX API, so that it can be compiled under Windows and Linux platforms. All Windows specific implementations are in the Win32 and all POSIX specific implementations are in posix subfolders.

Integrate google test in CMake

Goal
Integrate Google test in the AREG SDK to star developing unit tests.

Motivation
The unit tests are used to test small functions / functionalities and it is an effective tool to find and fix bugs. Applications having high rate of unit test code coverage are quite stable. Our minimum goal is to have high rate of code coverage of base module, which contains collection of bases objects.

Background information
AREG SDK is possible to compile via cmake. The GTest contains well description how to integrate it in the project via CMakeLists.txt. In addition, there are very many projects that can be an example of integrating GTest.

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.