Code Monkey home page Code Monkey logo

breep's People

Contributors

organic-code avatar tonykero 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  avatar  avatar  avatar  avatar

breep's Issues

Add a client-server model

Breed currently supports only peer-to-peer network architecture. It could be nice to add a client-server architecture.

Logger in wrong namespace

For example, in /include/breep/network/detail/object_builder.hpp, the logger is referenced as breep::logger.

I believe it should be breep::detail::logger.

This error was found while compiling the example code chat.

Edit: This was using g++<4.9. This doesn't occur with g++5

Edit2: Now getting a lot of BREEP_DECLARE_TEMPLATE-based errors. Saying things like:
template argument 1 is invalid, parse error in template argument list, expected unqualified-id before '...' token. It says in type_traits.hpp to use BREEP_DECLARE_TYPE instead of BREEP_DECLARE_TEMPLATE if getting errors. Is this the recommended action to take (editing basic_peer.hpp, io_manager_base.hpp, etc?

In file included from ../../include/breep/network/tcp.hpp:21:0,
                 from main.cpp:23:
../../include/breep/util/type_traits.hpp:66:221: error: expected ‘;’ at end of member declaration
          const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \
                                                                                                                                                                                                                             ^
../../include/breep/network/basic_peer.hpp:166:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’
 BREEP_DECLARE_TEMPLATE(breep::basic_peer)
 ^
../../include/breep/util/type_traits.hpp:66:221: error: declaration of ‘const string breep::detail::networking_traits_impl<breep::basic_peer<T ...> >::T’
          const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \
                                                                                                                                                                                                                             ^
../../include/breep/network/basic_peer.hpp:166:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’
 BREEP_DECLARE_TEMPLATE(breep::basic_peer)
 ^
../../include/breep/util/type_traits.hpp:63:16: error:  shadows template parm ‘class ... T’
      template <typename... T> \
                ^
../../include/breep/network/basic_peer.hpp:166:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’
 BREEP_DECLARE_TEMPLATE(breep::basic_peer)
 ^
../../include/breep/util/type_traits.hpp:66:222: error: expected unqualified-id before ‘...’ token
          const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \
                                                                                                                                                                                                                              ...

Compilation of the examples on Ubuntu 16.04 fails

Checked out both current master branch and 0.1.0 tag.
When trying to compile the examples by calling make, I get the following output:
Building chat.elf [ -- ] (1/1) Building main.o from main.cpp...In file included from ../../include/breep/network/tcp.hpp:21:0, from main.cpp:21: ../../include/breep/util/type_traits.hpp:66:221: error: expected ‘;’ at end of member declaration const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/detail/object_builder.hpp:151:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::detail::object_builder) ^ ../../include/breep/util/type_traits.hpp:66:221: error: declaration of ‘const string breep::detail::networking_traits_impl<breep::detail::object_builder<T ...> >::T’ const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/detail/object_builder.hpp:151:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::detail::object_builder) ^ ../../include/breep/util/type_traits.hpp:63:16: error: shadows template parm ‘class ... T’ template <typename... T> \ ^ ../../include/breep/network/detail/object_builder.hpp:151:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::detail::object_builder) ^ ../../include/breep/util/type_traits.hpp:66:222: error: expected unqualified-id before ‘...’ token const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/detail/object_builder.hpp:151:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::detail::object_builder) ^ ../../include/breep/util/type_traits.hpp:66:206: error: parse error in template argument list const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/detail/object_builder.hpp:151:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::detail::object_builder) ^ ../../include/breep/util/type_traits.hpp:66:206: error: template argument 1 is invalid const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/detail/object_builder.hpp:151:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::detail::object_builder) ^ ../../include/breep/util/type_traits.hpp:66:221: error: expected ‘;’ at end of member declaration const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/io_manager_base.hpp:158:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::io_manager_base) ^ ../../include/breep/util/type_traits.hpp:66:221: error: declaration of ‘const string breep::detail::networking_traits_impl<breep::io_manager_base<T ...> >::T’ const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/io_manager_base.hpp:158:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::io_manager_base) ^ ../../include/breep/util/type_traits.hpp:63:16: error: shadows template parm ‘class ... T’ template <typename... T> \ ^ ../../include/breep/network/io_manager_base.hpp:158:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::io_manager_base) ^ ../../include/breep/util/type_traits.hpp:66:222: error: expected unqualified-id before ‘...’ token const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/io_manager_base.hpp:158:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::io_manager_base) ^ ../../include/breep/util/type_traits.hpp:66:206: error: parse error in template argument list const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/io_manager_base.hpp:158:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::io_manager_base) ^ ../../include/breep/util/type_traits.hpp:66:206: error: template argument 1 is invalid const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/io_manager_base.hpp:158:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::io_manager_base) ^ ../../include/breep/util/type_traits.hpp:66:221: error: expected ‘;’ at end of member declaration const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_peer_manager.hpp:503:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_peer_manager) ^ ../../include/breep/util/type_traits.hpp:66:221: error: declaration of ‘const string breep::detail::networking_traits_impl<breep::basic_peer_manager<T ...> >::T’ const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_peer_manager.hpp:503:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_peer_manager) ^ ../../include/breep/util/type_traits.hpp:63:16: error: shadows template parm ‘class ... T’ template <typename... T> \ ^ ../../include/breep/network/basic_peer_manager.hpp:503:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_peer_manager) ^ ../../include/breep/util/type_traits.hpp:66:222: error: expected unqualified-id before ‘...’ token const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_peer_manager.hpp:503:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_peer_manager) ^ ../../include/breep/util/type_traits.hpp:66:206: error: parse error in template argument list const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_peer_manager.hpp:503:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_peer_manager) ^ ../../include/breep/util/type_traits.hpp:66:206: error: template argument 1 is invalid const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_peer_manager.hpp:503:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_peer_manager) ^ ../../include/breep/util/type_traits.hpp:66:221: error: expected ‘;’ at end of member declaration const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_network.hpp:653:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_network) ^ ../../include/breep/util/type_traits.hpp:66:221: error: declaration of ‘const string breep::detail::networking_traits_impl<breep::basic_network<T ...> >::T’ const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_network.hpp:653:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_network) ^ ../../include/breep/util/type_traits.hpp:63:16: error: shadows template parm ‘class ... T’ template <typename... T> \ ^ ../../include/breep/network/basic_network.hpp:653:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_network) ^ ../../include/breep/util/type_traits.hpp:66:222: error: expected unqualified-id before ‘...’ token const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_network.hpp:653:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_network) ^ ../../include/breep/util/type_traits.hpp:66:206: error: parse error in template argument list const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_network.hpp:653:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_network) ^ ../../include/breep/util/type_traits.hpp:66:206: error: template argument 1 is invalid const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ ../../include/breep/network/basic_network.hpp:653:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(breep::basic_network) ^ ../../include/breep/util/type_traits.hpp:66:221: error: expected ‘;’ at end of member declaration const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ main.cpp:88:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(chat_message) ^ ../../include/breep/util/type_traits.hpp:66:221: error: declaration of ‘const string breep::detail::networking_traits_impl<chat_message<T ...> >::T’ const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ main.cpp:88:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(chat_message) ^ ../../include/breep/util/type_traits.hpp:63:16: error: shadows template parm ‘class ... T’ template <typename... T> \ ^ main.cpp:88:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(chat_message) ^ ../../include/breep/util/type_traits.hpp:66:222: error: expected unqualified-id before ‘...’ token const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ main.cpp:88:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(chat_message) ^ ../../include/breep/util/type_traits.hpp:66:206: error: parse error in template argument list const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ main.cpp:88:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(chat_message) ^ ../../include/breep/util/type_traits.hpp:66:206: error: template argument 1 is invalid const std::string universal_name = std::string(#TType"<") + networking_traits_impl<typename std::tuple_element<0, std::tuple<T...>>::type>().universal_name + detail::identifier_from_tuple<detail::remove_type<0, T...>>().value + ">"; \ ^ main.cpp:88:1: note: in expansion of macro ‘BREEP_DECLARE_TEMPLATE’ BREEP_DECLARE_TEMPLATE(chat_message) ^ Makefile:224: die Regel für Ziel „build/main.o“ scheiterte make[1]: *** [build/main.o] Fehler 1 Makefile:161: die Regel für Ziel „all“ scheiterte make: *** [all] Fehler 2

The dependancies are installed. Do I need a special compiler version?

Possibility for network discovery/broadcast messages?

I'm interested in using this library for a project involving ad-hoc network building. How would you suggest building network discovery features to Breep? The simplest way that I can think of is to add broadcast messaging (using UDP, I suppose) to build a routing table. At least one problem with that, though, is that UDP still needs a router I think. Is there some forum where we could discuss this?

Alternatively, do you have links to sources where I can learn true peer-to-peer communication paradigm? Perhaps you have a diagram of Breep's comm flow or know of a similar one.

Cheers

Enable raw and smart pointer serialization

Pointers serialization does not work out of the box. this is a missing feature, and deep serialization should be enabled for raw pointers and smart pointers (namely std::weak_ptr, std::shared_ptr and std::unique_ptr)

Add a packet class

It may be useful to add a packet class overloading << operator, so as to be able to send more than one class at once

Peer bridging is broken

The forwarding requests seem to have no effect, leading to no one bridging for each other.

Errors when building with Visual Studio IDE

I get the following errors during compilation ( Microsoft Visual Studio Ultimate 2013):
error C2144: syntax error : 'bool' should be preceded by ';'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
etc.
all in type_traits.hpp.
Unfortunately I do not have any experience using GCC.
It will be much appreciated if you could help.

Conan package for Breep

Hello,
Do you know about Conan?
Conan is modern dependency manager for C++. And will be great if your library will be available via package manager for other developers.

Here you can find example, how you can create package for the library.

If you have any questions, just ask :-)

Adding user data in basic_peer

It could be useful to have the possibility of adding data in basic_peer, accessible from user code, so that they can avoid using an extra map of their own when they would otherwise need it

Add an ID system?

Anyone can connect to any peer network (provided that they have the same protocol ID), even though they are from a completely different program

Although this is unlikely, it should be taken into account, maybe by adding an ID when the network is created and checking it on incomming connections.

Change the serialization system

Because of the way boost's serialization is used, it is not possible to send a class without first copying it (at least for const refs), which is quite bad.

One solution could be to implement a custom serialization system.

Add stream watchers?

It could be nice to be able to add a watcher so that you can know when you are receiving bytes, even if data are not completely received yet

Add bytes hook on basic_network

Adding hooks after serializing objects and before deserializing them could be useful in some circumstances (encryption & decryption, compression & decompression, …)

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.