Git Product home page Git Product logo

msghub's People

Contributors

di9it avatar oleksandrgl avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

msghub's Issues

Issue in data publishing

Hi,

I am trying to create a pub/sub model using BoostAsio library with the help of your code.

I was able to establish a connection between the publisher and subscriber but the data is neither [published nor subscribe.

Could you please help me with the issue.

Thanks & Regards
Rakshita Parihar

Fix compilation warnings

There are many warnings (with -Wall -Wextra -pedantic). Some of these are already bugs (leading to immediate segfaults), some of them simply invite bugs. Others may prevent correct compilation on standard conforming compilers.

|| [ 14%] Building CXX object CMakeFiles/client.dir/msghub/src/hubclient.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubclient.h:6,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| [ 21%] Building CXX object CMakeFiles/client.dir/msghub/src/hubconnection.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h:5,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.cpp:1:
|| /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h: In constructor ‘hubconnection::hubconnection(boost::asio::io_service&, hub&)’:
msghub/src/hubconnection.h|45 col 18| warning: ‘hubconnection::socket_’ will be initialized after [-Wreorder]
||    45 |  tcp::socket     socket_;
||       |                  ^~~~~~~
msghub/src/hubconnection.h|43 col 12| warning:   ‘hub& hubconnection::courier_’ [-Wreorder]
||    43 |  hub&      courier_;
||       |            ^~~~~~~~
msghub/src/hubconnection.cpp|24 col 1| warning:   when initialized here [-Wreorder]
||    24 | hubconnection::hubconnection(boost::asio::io_service& io_service, hub& courier)
||       | ^~~~~~~~~~~~~
|| [ 28%] Building CXX object CMakeFiles/client.dir/msghub/src/hubmessage.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubmessage.cpp:1:
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| [ 35%] Building CXX object CMakeFiles/client.dir/msghub/src/msghub.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h:5,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| [ 42%] Building CXX object CMakeFiles/client.dir/msghub/src/msghub_impl.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h:5,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp:1:
|| /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.h: In constructor ‘msghub_impl::msghub_impl(boost::asio::io_service&)’:
msghub/src/msghub_impl.h|47 col 35| warning: ‘msghub_impl::publisher_’ will be initialized after [-Wreorder]
||    47 |  boost::shared_ptr<hubconnection> publisher_;
||       |                                   ^~~~~~~~~~
msghub/src/msghub_impl.h|45 col 16| warning:   ‘boost::asio::ip::tcp::acceptor msghub_impl::acceptor_’ [-Wreorder]
||    45 |  tcp::acceptor acceptor_;
||       |                ^~~~~~~~~
msghub/src/msghub_impl.cpp|46 col 1| warning:   when initialized here [-Wreorder]
||    46 | msghub_impl::msghub_impl(boost::asio::io_service& io_service)
||       | ^~~~~~~~~~~
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp:1:
msghub/src/msghub_impl.h|45 col 16| warning: ‘msghub_impl::acceptor_’ will be initialized after [-Wreorder]
||    45 |  tcp::acceptor acceptor_;
||       |                ^~~~~~~~~
msghub/src/msghub_impl.h|44 col 27| warning:   ‘boost::asio::io_service& msghub_impl::io_service_’ [-Wreorder]
||    44 |  boost::asio::io_service& io_service_;
||       |                           ^~~~~~~~~~~
msghub/src/msghub_impl.cpp|46 col 1| warning:   when initialized here [-Wreorder]
||    46 | msghub_impl::msghub_impl(boost::asio::io_service& io_service)
||       | ^~~~~~~~~~~
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp:1:
msghub/src/msghub_impl.h|44 col 27| warning: ‘msghub_impl::io_service_’ will be initialized after [-Wreorder]
||    44 |  boost::asio::io_service& io_service_;
||       |                           ^~~~~~~~~~~
msghub/src/msghub_impl.h|42 col 8| warning:   ‘bool msghub_impl::initok_’ [-Wreorder]
||    42 |  bool  initok_;
||       |        ^~~~~~~
msghub/src/msghub_impl.cpp|46 col 1| warning:   when initialized here [-Wreorder]
||    46 | msghub_impl::msghub_impl(boost::asio::io_service& io_service)
||       | ^~~~~~~~~~~
|| /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp: In member function ‘virtual void msghub_impl::deliver(boost::shared_ptr<hubconnection>, hubmessage&)’:
msghub/src/msghub_impl.cpp|203 col 60| warning: unused parameter ‘publisher’ [-Wunused-parameter]
||   203 | void msghub_impl::deliver(boost::shared_ptr<hubconnection> publisher, hubmessage& msg)
||       |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
|| /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp: In member function ‘void msghub_impl::handle_accept(boost::shared_ptr<hubclient>, const boost::system::error_code&)’:
msghub/src/msghub_impl.cpp|233 col 7| warning: unused variable ‘e’ [-Wunused-variable]
||   233 |   int e = error.value();
||       |       ^
|| [ 50%] Linking CXX executable client
|| [ 50%] Built target client
|| [ 57%] Building CXX object CMakeFiles/server.dir/test.cpp.o
|| [ 64%] Building CXX object CMakeFiles/server.dir/msghub/src/hubclient.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubclient.h:6,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| [ 71%] Building CXX object CMakeFiles/server.dir/msghub/src/hubconnection.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h:5,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.cpp:1:
|| /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h: In constructor ‘hubconnection::hubconnection(boost::asio::io_service&, hub&)’:
msghub/src/hubconnection.h|45 col 18| warning: ‘hubconnection::socket_’ will be initialized after [-Wreorder]
||    45 |  tcp::socket     socket_;
||       |                  ^~~~~~~
msghub/src/hubconnection.h|43 col 12| warning:   ‘hub& hubconnection::courier_’ [-Wreorder]
||    43 |  hub&      courier_;
||       |            ^~~~~~~~
msghub/src/hubconnection.cpp|24 col 1| warning:   when initialized here [-Wreorder]
||    24 | hubconnection::hubconnection(boost::asio::io_service& io_service, hub& courier)
||       | ^~~~~~~~~~~~~
|| [ 78%] Building CXX object CMakeFiles/server.dir/msghub/src/hubmessage.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubmessage.cpp:1:
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| [ 85%] Building CXX object CMakeFiles/server.dir/msghub/src/msghub.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h:5,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| [ 92%] Building CXX object CMakeFiles/server.dir/msghub/src/msghub_impl.cpp.o
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/hubconnection.h:5,
msghub/src/hubmessage.h|31 col 3| warning: ISO C++ prohibits anonymous structs [-Wpedantic]
||    31 |   {
||       |   ^
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp:1:
|| /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.h: In constructor ‘msghub_impl::msghub_impl(boost::asio::io_service&)’:
msghub/src/msghub_impl.h|47 col 35| warning: ‘msghub_impl::publisher_’ will be initialized after [-Wreorder]
||    47 |  boost::shared_ptr<hubconnection> publisher_;
||       |                                   ^~~~~~~~~~
msghub/src/msghub_impl.h|45 col 16| warning:   ‘boost::asio::ip::tcp::acceptor msghub_impl::acceptor_’ [-Wreorder]
||    45 |  tcp::acceptor acceptor_;
||       |                ^~~~~~~~~
msghub/src/msghub_impl.cpp|46 col 1| warning:   when initialized here [-Wreorder]
||    46 | msghub_impl::msghub_impl(boost::asio::io_service& io_service)
||       | ^~~~~~~~~~~
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp:1:
msghub/src/msghub_impl.h|45 col 16| warning: ‘msghub_impl::acceptor_’ will be initialized after [-Wreorder]
||    45 |  tcp::acceptor acceptor_;
||       |                ^~~~~~~~~
msghub/src/msghub_impl.h|44 col 27| warning:   ‘boost::asio::io_service& msghub_impl::io_service_’ [-Wreorder]
||    44 |  boost::asio::io_service& io_service_;
||       |                           ^~~~~~~~~~~
msghub/src/msghub_impl.cpp|46 col 1| warning:   when initialized here [-Wreorder]
||    46 | msghub_impl::msghub_impl(boost::asio::io_service& io_service)
||       | ^~~~~~~~~~~
|| In file included from /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp:1:
msghub/src/msghub_impl.h|44 col 27| warning: ‘msghub_impl::io_service_’ will be initialized after [-Wreorder]
||    44 |  boost::asio::io_service& io_service_;
||       |                           ^~~~~~~~~~~
msghub/src/msghub_impl.h|42 col 8| warning:   ‘bool msghub_impl::initok_’ [-Wreorder]
||    42 |  bool  initok_;
||       |        ^~~~~~~
msghub/src/msghub_impl.cpp|46 col 1| warning:   when initialized here [-Wreorder]
||    46 | msghub_impl::msghub_impl(boost::asio::io_service& io_service)
||       | ^~~~~~~~~~~
|| /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp: In member function ‘virtual void msghub_impl::deliver(boost::shared_ptr<hubconnection>, hubmessage&)’:
msghub/src/msghub_impl.cpp|203 col 60| warning: unused parameter ‘publisher’ [-Wunused-parameter]
||   203 | void msghub_impl::deliver(boost::shared_ptr<hubconnection> publisher, hubmessage& msg)
||       |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
|| /home/sehe/Projects/stackoverflow/msghub/src/msghub_impl.cpp: In member function ‘void msghub_impl::handle_accept(boost::shared_ptr<hubclient>, const boost::system::error_code&)’:
msghub/src/msghub_impl.cpp|233 col 7| warning: unused variable ‘e’ [-Wunused-variable]
||   233 |   int e = error.value();
||       |       ^
|| [100%] Linking CXX executable server
|| [100%] Built target server

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.