Giter Site home page Giter Site logo

bonefish's People

Contributors

afra-felix avatar davidchappelle avatar efidler avatar jpetso avatar jrogers avatar leoyanggit avatar pascal-simon avatar topologybj avatar ve3rqx 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

Watchers

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

bonefish's Issues

inter-operate with AutobahnCpp example

Compile AutobahnCpp example https://github.com/tavendo/AutobahnCpp/blob/master/examples/call1.cpp and use it to connect to bonefish server. (there is no one register the RPC method to be called). I'd expect bonefish can return error indicate that RPC method does not exist.

On client side, I got the following message:
[root@wanzh02-usb-1 src]# ./caller
Running on 105800
Starting ASIO I/O loop ..
Connected to server
TX message (57 octets) ...
TX message sent (61 / 61 octets)
RawSocket handshake reply received
RawSocket handshake reply is valid: start WAMP message send-receive loop
RX preparing to receive message ..
RX message (59 octets) ...
RX message received.
RX WAMP message: [2, 7090515283965860, {"roles"=>{"dealer"=>{"features"=>{"call_timeout"=>true}}, "broker"=>{}}}]
RX preparing to receive message ..
Session joined to realm with session ID 7090515283965860
TX message (30 octets) ...
TX message sent (34 / 34 octets)

On bonefish server side, I got the following message:
[root@wanzh02-usb-1 daemon]# ./bonefish --realm "default" --websocket-port 9999 --rawsocket-port 8888 --debu
[rawsocket_server_impl.cpp:65][start] starting rawsocket server
[tcp_listener.cpp:42][start_listening] starting tcp listener: 0.0.0.0:8888
[websocket_server_impl.cpp:53][start] starting websocket server: 0.0.0.0:9999
[wamp_message_processor.cpp:46][process_message] processing message: hello
[wamp_router_impl.cpp:107][attach_session] attaching session: session [7090515283965860,default,none]
[wamp_dealer.cpp:62][attach_session] attach session: session [7090515283965860,default,none]
[wamp_broker.cpp:51][attach_session] attach session: session [7090515283965860,default,none]
[wamp_router_impl.cpp:163][process_hello_message] session [7090515283965860,default,none], hello [default, {"roles"=>{"caller"=>{}, "callee"=>{}, "publisher"=>{}, "subscriber"=>{}}}]
[wamp_router_impl.cpp:191][process_hello_message] session [7090515283965860,default,open], welcome [7090515283965860, {"roles"=>{"dealer"=>{"features"=>{"call_timeout"=>true}}, "broker"=>{}}}]
[rawsocket_transport.cpp:39][send_message] sending message: welcome
[wamp_message_processor.cpp:46][process_message] processing message: call
[wamp_dealer.cpp:163][process_call_message] session [7090515283965860,default,open], call [1, {}, com.mathservice.add2, [23, 777], nil]
[rawsocket_server_impl.cpp:224][on_message] unhandled exception: regex_error

Compile environment

This is just a question. As there is no discussion group, I have to post it here.

I found if remove "-fdiagnostics-color=always", then the code can be compiled using gcc 4.8.

My question is, do you really need a very recent compiler? Or you have used any c++11 feature?

Most recent compiler means we have to ship a libstdc++ library along with bonefish binary.

Interoperate with ccpwamp example

I am interested by wamp and specially by bonefish implementation to use in an embedded device.

I tried to use a cppwamp example : [https://github.com/ecorm/cppwamp/tree/master/examples/timeservice] but the behaviour is not correct. It seems Bonefish block the publish action ( compared to crossbar for example) . I begun to assume that the problem could be due to lack of acknowledgements support but I am not sure.
Could you confirm this problem and/or give a trail to solve the problem ?

Here is the code

[rawsocket_server_impl.cpp:94][start] starting rawsocket server
[websocket_server_impl.cpp:54][start] starting websocket server: 0.0.0.0:9999
creating uds connection
[wamp_message_processor.cpp:46][process_message] processing message: hello
[wamp_router_impl.cpp:108][attach_session] attaching session: session [7090515283965860,cppwamp.demo.time,none]
[wamp_dealer.cpp:65][attach_session] attach session: session [7090515283965860,cppwamp.demo.time,none]
[wamp_broker.cpp:51][attach_session] attach session: session [7090515283965860,cppwamp.demo.time,none]
[wamp_router_impl.cpp:164][process_hello_message] session [7090515283965860,cppwamp.demo.time,none], hello [cppwamp.demo.time, {"agent":"cppwamp-0.6.2", "roles":{"callee":{"features":{"call_trustlevels":true, "caller_identification":true, "pattern_based_registration":true, "progressive_call_results":true}}, "caller":{"features":{"call_timeout":true, "callee_blackwhite_listing":true, "caller_exclusion":true, "caller_identification":true}}, "publisher":{"features":{"publisher_exclusion":true, "publisher_identification":true, "subscriber_blackwhite_listing":true}}, "subscriber":{"features":{"pattern_based_subscription":true, "publication_trustlevels":true, "publisher_identification":true}}}}]
[wamp_router_impl.cpp:192][process_hello_message] session [7090515283965860,cppwamp.demo.time,open], welcome [7090515283965860, {"roles":{"dealer":{"features":{"call_timeout":true, "progressive_call_results":true}}, "broker":{}}}]
[rawsocket_transport.cpp:39][send_message] sending message: welcome
[wamp_message_processor.cpp:46][process_message] processing message: register
[wamp_dealer.cpp:304][process_register_message] session [7090515283965860,cppwamp.demo.time,open], register [1, {}, get_time]
[wamp_dealer.cpp:345][process_register_message] session [7090515283965860,cppwamp.demo.time,open], registered [1, 1]
[rawsocket_transport.cpp:39][send_message] sending message: registered
[wamp_message_processor.cpp:46][process_message] processing message: publish
[wamp_broker.cpp:111][process_publish_message] session [7090515283965860,cppwamp.demo.time,open], publish [2, {"acknowledge":true}, time_tick, [{"hour":18, "isdst":1, "mday":17, "min":53, "mon":4, "sec":37, "wday":2, "yday":137, "year":116}], nil]

and in the cppwamp example the output "Tick" of:
session->publish(Pub("time_tick").withArgs(*local), yield);
std::cout << "Tick\n";

``
doesn't appear in the console (but it appears with crossbar for example) .

Add support for progressive call results

Great to finally see this in the light David (and all you others of course)! It looks great.

We're currently using Crossbar at work, but treating it as a "black box" and not making use of its application component hosting features (and many other features), and using another router which is more slim is thus of interest to us.

One thing we need though from the Advanced Profile is progressive call result (a stable part), as we're using this to deliver frames from an image detector. I don't know how high up on your agenda this is, but I'm filing this issue to keep track.

[feature] Add support for unix domain sockets

A new server endpoint for unix domain sockets must be added to bonefish. This should be a matter of abstracting some of the rawsocket code to accommodate different types of endpoints. Or at least abstracting the rawsocket handshake code. The example bonefish daemon should be updated to include a domain socket server endpoint. The autobahn-cpp library should also be updated to include an example using unix domain sockets.

invalid array index in bonefish/messages/wamp_welcome_details.cpp

Results in a hard crash on Windows build; problem did not surface on Linux, nor was picked up via valgrind or similar tools.

Problem is on lines 57-61. Array allocated for size 1 on lines 57-59, but indexed on lines 60-61 using loop iterator. The fix is simple: change "index" to "0".

While I am here, is there any extant example of in-process client side use of the "native_server"?

[performance] Improve performance of transient message fields

Often times the arguments and kw_arguments passed forward from a request message or returned in a response message are simply copied. These can be fairly elaborate structures being passed back and forth. Each message now has the concept of a movable msgpack::zone which can be passed from request->response and vice versa. This means that it is not required to deeply copy these fields and we can simply shallow copy the msgpack::object from one message to another in conjunction with passing ownership of (moving) the underlying msgpack::zone between messages. Using bonefish::wamp_call_message as an example:

void set_arguments(const msgpack::object& arguments);
void set_arguments(const msgpack::object& arguments);

The API should be that if a message field is being set from a msgpack::object as in the case above, then the requirement must be that the object was allocated from the same zone and therefore can simply be shallow copied. So in the case of CALL->INVOCATION:

    std::unique_ptr<wamp_invocation_message> invocation_message(
            new wamp_invocation_message(std::move(call_message->release_zone())));
    invocation_message->set_request_id(request_id);
    invocation_message->set_registration_id(registration_id);
    invocation_message->set_arguments(call_message->get_arguments());
    invocation_message->set_arguments_kw(call_message->get_arguments_kw());

The invocation message takes ownership of the call messages zone and therefore, we can simply set the invocations arguments and kw_arguments from the call message and shallow copy instead of deep copy. To facilitate this we need to add a new constructor to the messages that are involved in these transient operations. For example:

wamp_invocation_message(std::unique_ptr<msgpack::zone>&& zone);

"rawsocket handshake error" when used with Autobahn|CPP?

Hi,

I'm getting a "rawsocket handshake error" and an immediate disconnect (TCP reset) when trying to use Autobahn and Bonefish together over raw TCP on loopback.

Even with debugging enabled in both Bonefish and Autobahn I'm not getting much in the way of useful errors out. Am I missing something really obvious?

I've tested this on both MSVC 2015 and GCC 7.1 and get the same result.

#include <iostream>
#include <autobahn/autobahn.hpp>
#include <bonefish/rawsocket/rawsocket_server.hpp>
#include <bonefish/rawsocket/tcp_listener.hpp>
#include <bonefish/router/wamp_routers.hpp>
#include <bonefish/serialization/wamp_serializers.hpp>
#include <bonefish/serialization/msgpack_serializer.hpp>
#include <bonefish/trace/trace.hpp>
#include <boost/asio/io_service.hpp>
#include <memory>

namespace ip =  boost::asio::ip;
using tcp = ip::tcp;

static void
start_wamp_router (boost::asio::io_service& io_service) {
    bonefish::trace::set_enabled (true);

    auto routers = std::make_shared<bonefish::wamp_routers>();
    auto router  = std::make_shared<bonefish::wamp_router>(io_service, "default");
    routers->add_router(router);

    auto serializers = std::make_shared<bonefish::wamp_serializers>();
    serializers->add_serializer (std::make_shared<bonefish::msgpack_serializer>());

    auto rawsocket_server = std::make_shared<bonefish::rawsocket_server>
                            (routers, serializers);
    auto tcp_listener = std::make_shared<bonefish::tcp_listener>
                        (io_service, ip::address_v4::from_string("127.0.0.1"), 24888);

    rawsocket_server->attach_listener
        (std::static_pointer_cast<bonefish::rawsocket_listener>(tcp_listener));

    rawsocket_server->start();
}

int
main() {
    boost::asio::io_service io_service;

    start_wamp_router (io_service);
    bool const debug = true;

    auto session = std::make_shared<autobahn::wamp_session>(io_service, debug);
    auto transport = std::make_shared<autobahn::wamp_tcp_transport>
                        (io_service, tcp::endpoint
                            (ip::address_v4::from_string("127.0.0.1"), 24888), debug);

    transport->attach (std::static_pointer_cast<autobahn::wamp_transport_handler>(session));
    transport->connect().then ([](boost::future<void> connected) {
        try {
            connected.get(); // This throws
        } catch (const std::exception& e) {
            std::cerr << e.what() << std::endl;
            throw;
        }
        std::cout << "Connected!" << std::endl;
    });

    io_service.run();
}

bad_alloc exception at websocket_server_impl.cpp:220

I'm running bonefish in a docker container. When I try this simple javascript, I get this on bonefish:

<!DOCTYPE html>
<html>
   <body>
      <script
         src="https://autobahn.s3.amazonaws.com/autobahnjs/latest/autobahn.min.jgz">
      </script>
      <script>
var connection = new autobahn.Connection({
   url: "ws://localhost:9999",
   realm: "default"
});
connection.onopen = function (session, details) {
    console.log(session, details);
};

connection.onclose = function (reason, details) {
   console.log("Connection lost: " + reason);
}

// Open connection
connection.open();
        </script>
   </body>
</html>
[websocket_server_impl.cpp:53][start] starting websocket server: 0.0.0.0:9999
[2015-08-28 23:58:43] [connect] WebSocket Connection 172.17.42.1:40386 v13 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36" / 101
[websocket_server_impl.cpp:220][on_message] unhandled exception: std::bad_alloc

After I close the browser tab it says this:

[2015-08-29 00:02:27] [control] Control frame received with opcode 8
[2015-08-29 00:02:27] [frame_header] Dispatching write containing 1 message(s) containing 2 header bytes and 2 payload bytes
[2015-08-29 00:02:27] [frame_header] Header Bytes: 
[0] (2) 88 02 

[2015-08-29 00:02:27] [frame_payload] Payload Bytes: 
[0] (2) [8] 03 E9 

[2015-08-29 00:02:27] [disconnect] Disconnect close local:[1001] remote:[1001]

The dockerfile is here, so hopefully it is easily reproducible:
https://gist.github.com/DuGuille/1eca9a127ca281aa0ea9

Dynamic Realm Support

This is a great looking project. It's really great to see a nice minimalist WAMP router as a static library. I am somewhat in the same boat as @estan who opened #9 but also could really use automatically managed realms as well. So by that I mean that a realm would be created when a client tried to join it and would be thrown out when the last client left it. I think this would be really convenient for people doing WAMP development as well. What would you guys think about incorporating something like that into the codebase?

My C++ is rusty almost to the point of being non-existent but I did manage to put together a proof of concept branch. It definitely would require someone more knowledgeable to go over but the general approach I tried was:

  1. Allow src/bonefish/router/wamp_routers to track an io_service reference and use it to create and add routers/realms in get_realm
  2. Expose a has_sessions() method on the src/bonefish/router/wamp_router
  3. Have the on_close and on_fail handlers from websocket_server remove the realm if has_sessions() returns false.

I modified examples/integration.cpp to run this "dynamic" mode. The standard bonefish binary works exactly as before. I don't think this is PR worthy yet but wanted to see what folks thought. And definitely point out anything i'm thinking about wrong. Thanks.

Add the ability for routers to manage multiple realms

Since the original use cases for bonefish were very simple it made the most sense to allow for a 1:1 relationship between routers and realms. However, in order to be useful to a wider range of use cases a router needs to be capable of managing multiple realms. Of course, this would still provide the ability for the administrator to create 1:1 relationships if so desired.

build problem cannot find boost

Hello, I am trying to build bonefish on windows 10. I installed QT and use MinGW which came with QT. The necessary boost libraries are compiled and located at C:\boost_1_61_0. The bonefish resources are located in C:\bonefish-master. Within that folder I created a build-folder (C:\bonefish-master\bonefish-build). Out of this folder I run the command “cmake -G "MinGW Makefiles" ../”. While the build process I get the attached error message. Basically the boost library is not found. Now the question arises where and how I have to specify the path to the boost library. What about the RT_Library? Thanks a lot in advance. Cheers Marcel
cmake_cmd

CMakeOutput.TXT

Add Python/NodeJS bindings for the bonefish library

I think it would be really cool to use bonefish as a library in Python, NodeJS or potentially other languages. I looked into it a little and some of the options (for python anyway) seem to be SWIG, Boost::Python, Cython, or a C interface called with cffi. In the discussion for #31, @davidchappelle mentioned that there may already be a nice framework for developing these, so just moving the conversation here.

Problem building on Windows

I am trying to build bonefish on a windows 7 system and I am running into some problems.
I am using either MSVC 2015 of GCC version 5.3.0 (buildt by the MinGW-W64 project) and Boost version 1.60.

For my GCC attempt I created a folder "C:\temp\bonefish\bonefish-build" and executed:

cmake -G "CodeBlocks - MinGW Makefiles" ../
mingW32-make -f Makefile

from the command-line within that directory.
This failed after it created among others: C:\temp\bonefish\bonefish-build\CMakeCache.txt
In that file I have modified all references to the pre-build Boost libraries (program_options, system, thread, chrono, date_time and atomic).

Because I am on a Windows system I also had to change RT_LIBRARY:FILEPATH. In my case i had to change it to (depending on the location of the compiler):
RT_LIBRARY:FILEPATH=C:/mingw32/i686-w64-mingw32/lib/libws2_32.a

I ran both commands again and got a Code::Blocks project, but it would not build yet.
In bonefish/rawsocket/rawsocket_connection.hpp there is an include of <arpa/inet.h>, that does not exist on Windows. I had to change that include to <winsock2.h>. Maybe an #ifdef can be used here?

Because I know that including winsock2 often causes problems if WIN32_LEAN_AND_MEAN has not been defined I also defined this for the project. I did this by editing bonefish\CMakeLists.txt:

if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0500)
endif()

became

if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0500)
add_definitions(-DWIN32_LEAN_AND_MEAN)
endif()

Subsequently I ran into problems with the third-party includes from: bonefish\third-party\msgpack-c
These problems could be overcome by reverting the msgpack-c files to the revision mentioned in the readme.md and changing: bonefish/CMakeList.txt

if(NOT MSVC)
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wno-unused-variable -std=c++11 ${CMAKE_CXX_FLAGS}")
else()

into:

if(NOT MSVC)
set(CMAKE_CXX_FLAGS "-Wall -Werror -Wno-unused-variable -fno-strict-aliasing -std=c++11 ${CMAKE_CXX_FLAGS}")
else()

I ran both commands again and got a Code::Blocks project, but it would not build yet.
Now if I try to build the project I get errors from bonefish/src/bonefish/rawsocket/uds_listener stating that:

In file included from C:\temp\bonefish\src\bonefish\rawsocket\uds_listener.cpp:17:0:
C:/temp/bonefish/src/bonefish/rawsocket/uds_listener.hpp:47
C:/temp/bonefish/rawsocket/uds_listener.hpp:48
C:/temp/bonefish/rawsocket/uds_listener.hpp:49
In file included from C:\temp\bonefish\src\bonefish\rawsocket\uds_listener.cpp:18
C:/temp/bonefish/rawsocket/uds_connection.hpp:32
error: 'local' in namespace 'boost::asio' does not name a type

And some other errors that seem to be the result of these.

Now I don't have any ideas bot how to overcome this one and I hope someone will be able to help me bit. Also, if there is a pre-compiled stand-alone router or a DLL that I could use on a windows 7 system I would appreciate to get those so that I can also spend some time on trying out the actual communication.

Kind regards, Nico

Segfault on unexpected subscriber disconnect

Bonefish dies with SEGFAULT when unexpected client disconnect detected in wamp_broker::process_publish_message.
The problem is that topic_subscriptions_itr invalidated after disconnected session detach.

How to reproduce:

  1. Connect client A to bonefish and subscribe to topic T
  2. Connect client B to bonefish and start publishing T periodically
  3. Kill client A (without clean WAMP disconnect procedure)

Logs:

[wamp_broker.cpp:112][process_publish_message] session-id 2257228500326156
[wamp_broker.cpp:113][process_publish_message] session [2257228500326156,realm1,open], publish [7457382369929906, {}, com.myapp.hello, ["Hello, world!"], nil]
[wamp_broker.cpp:148][process_publish_message] Subscription 1 of 2
[wamp_broker.cpp:150][process_publish_message] session [2257228500326156,realm1,open], event [3, 6749176572856079, {}, ["Hello, world!"], nil]
[websocket_transport.cpp:39][send_message] sending message: event
[wamp_broker.cpp:148][process_publish_message] Subscription 2 of 2
[wamp_broker.cpp:150][process_publish_message] session [7090515283965860,realm1,open], event [2, 6749176572856079, {}, ["Hello, world!"], nil]
[rawsocket_transport.cpp:39][send_message] sending message: event
[rawsocket_connection.hpp:306][handle_system_error] connection failed: system:32
[wamp_dealer.cpp:82][detach_session] detach session: session [7090515283965860,realm1,open]
[wamp_dealer.cpp:87][detach_session] cleaning up session registrations
[wamp_dealer.cpp:116][detach_session] cleaning up pending caller invocations
[wamp_dealer.cpp:136][detach_session] cleaning up pending callee invocations
[wamp_broker.cpp:66][detach_session] detach session-id: 7090515283965860
[wamp_broker.cpp:67][detach_session] detach session: 0x88d310
[wamp_broker.cpp:70][detach_session] cleaning up session subscriptions
[wamp_broker.cpp:79][detach_session] cleaning up subscription topic
[wamp_broker.cpp:91][detach_session] cleaning up topic subscriptions
[wamp_broker.cpp:79][detach_session] cleaning up subscription topic
[wamp_broker.cpp:91][detach_session] cleaning up topic subscriptions
[wamp_broker.cpp:148][process_publish_message] Subscription 3 of 2 (WTF?)
[wamp_broker.cpp:150][process_publish_message] Segmentation fault

Bonefish websocket on TLS

On the front page of this repository/project, one reads that the daemon can be started as follows.

daemon/bonefish --realm "default" --websocket-port 9999

Does the --websocket-port cover both TLS and non-TLS uses?

How does one choose just one of them (e.g, the TLS one, and therefore forbid non-TLS use)?

Is there any other (command-line) configuration option pertaining to TLS?

Upgrade to websocketpp 0.7,

Hi,
there is a problem with websocketpp 0.6 that you are referencing as submodule when cross compiling for ARMv5TE. I just ran into this issue on my embedded device ...
Please update to websocketpp 0.7.

regards,
fabian büttner

Autobahn Python/JS Interoperability fails due to handling of msgpack bintype

This is an issue I talked (too much) about in #9. It can be observed by trying out the basic arguments autobahn example and removing any of the u"..." prefixes in the responses. This is most relevant in python 2.7 though will likely arise in 3.x in b"..." prefixed strings. A small discussion of the underlying problem (and a kindof fix) is present in the Autobahn|Python source, here (the docstring).

I was able to fix the issue for the referenced example by uncommenting the from_bin function in json_msgpack_sax.hpp included from tplgy/json-msgpack

The diff is small and there may be a good reason for the original commented out version so will just post it here:

--- a/include/json_msgpack/json_msgpack_sax.hpp
+++ b/include/json_msgpack/json_msgpack_sax.hpp
@@ -71,10 +71,10 @@ struct no_custom_string_conversion
     }

     template <typename Writer>
-    inline static bool from_bin(Writer&, const msgpack::object&)
+    inline static bool from_bin(Writer& writer, const msgpack::object& o)
     {
-        //return writer.String(o.via.bin.ptr, o.via.bin.size);
-        return false;
+        return writer.String(o.via.bin.ptr, o.via.bin.size);
+        //return false;
     }

     template <typename Writer>

Does anyone know if that change safe to make / merge? or would it break bin types being translated from msgpack<->msgpack based WAMP clients. Maybe the case should be handled differently?

Add SSL support to rawsocket subsystem

Hello!

I am building a small network for little devices to talk to each other. I love your project so far but it needs SSL support to be used in a production environment. When will you implement this?

Thanks!
Pawel

./daemon/bonefish,how restart

daemon/bonefish --realm "default" --websocket-port 9999 --rawsocket-port 8888
the command run bonefish as a standalone WAMP server,
but how resart bonefish wamp server

Add proper daemon configuration mechanism

When the daemon was initially written there were very few options to support and it was serving more as a test harness or proof of concept rather than something that would be actually deployed. In order to build out bonefish into a more feature rich application router it needs to have a proper configuration mechanism. This mechanism would allow for any number of routers to be configured along with their associated realms and transports. Before doing any work here we will first need to re-evaluate the internal relationships between routers, realms and transports to make sure that the configuration is correctly modelled.

Add web server endpoint for bonefish

Run bonefish:
./bonefish --realm "default" --websocket-port 9999

Open browser, browse URL: http://IP:9999

Nothing is shown in browser.

bonefish debug trace complain "upgrade required".

In such case, crossbar.io can show a default web page. I think it's a good idea to test if the server is running.

Compilation Error

I am getting a compilation error, Can any one help me in this?

[ 2%] Building CXX object src/CMakeFiles/bonefish.dir/bonefish/native/native_server_impl.cpp.o
In file included from /home/user1/work/bonefish/src/bonefish/native/native_endpoint.hpp:25:0,
from /home/user1/work/bonefish/src/bonefish/native/native_connector.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.hpp:21,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:17:
/usr/include/boost/thread/future.hpp: In instantiation of 'void boost::promise::set_exception(E) [with E = std::runtime_error; R = std::shared_ptrbonefish::native_endpoint]':
/home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:66:74: required from here
/usr/include/boost/thread/future.hpp:2092:42: error: call of overloaded 'copy_exception(std::runtime_error&)' is ambiguous
set_exception(copy_exception(ex));
^
/usr/include/boost/thread/future.hpp:2092:42: note: candidates are:
In file included from /usr/include/boost/exception_ptr.hpp:9:0,
from /usr/include/boost/thread/future.hpp:28,
from /home/user1/work/bonefish/src/bonefish/native/native_endpoint.hpp:25,
from /home/user1/work/bonefish/src/bonefish/native/native_connector.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.hpp:21,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:17:
/usr/include/boost/exception/detail/exception_ptr.hpp:75:5: note: boost::exception_ptr boost::copy_exception(const T&) [with T = std::runtime_error]
copy_exception( T const & e )
^
In file included from /usr/include/c++/4.9/exception:162:0,
from /usr/include/c++/4.9/typeinfo:34,
from /usr/include/c++/4.9/functional:53,
from /home/user1/work/bonefish/src/bonefish/identifiers/wamp_random_id.hpp:21,
from /home/user1/work/bonefish/src/bonefish/identifiers/wamp_session_id.hpp:20,
from /home/user1/work/bonefish/src/bonefish/common/wamp_message_processor.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:17:
/usr/include/c++/4.9/bits/exception_ptr.h:193:5: note: std::__exception_ptr::exception_ptr std::copy_exception(_Ex) [with _Ex = std::runtime_error]
copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT
^
In file included from /home/user1/work/bonefish/src/bonefish/native/native_endpoint.hpp:25:0,
from /home/user1/work/bonefish/src/bonefish/native/native_connector.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.hpp:21,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:17:
/usr/include/boost/thread/future.hpp: In instantiation of 'void boost::promise::set_exception(E) [with E = std::runtime_error]':
/home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:95:80: required from here
/usr/include/boost/thread/future.hpp:2409:42: error: call of overloaded 'copy_exception(std::runtime_error&)' is ambiguous
set_exception(copy_exception(ex));
^
/usr/include/boost/thread/future.hpp:2409:42: note: candidates are:
In file included from /usr/include/boost/exception_ptr.hpp:9:0,
from /usr/include/boost/thread/future.hpp:28,
from /home/user1/work/bonefish/src/bonefish/native/native_endpoint.hpp:25,
from /home/user1/work/bonefish/src/bonefish/native/native_connector.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.hpp:21,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:17:
/usr/include/boost/exception/detail/exception_ptr.hpp:75:5: note: boost::exception_ptr boost::copy_exception(const T&) [with T = std::runtime_error]
copy_exception( T const & e )
^
In file included from /usr/include/c++/4.9/exception:162:0,
from /usr/include/c++/4.9/typeinfo:34,
from /usr/include/c++/4.9/functional:53,
from /home/user1/work/bonefish/src/bonefish/identifiers/wamp_random_id.hpp:21,
from /home/user1/work/bonefish/src/bonefish/identifiers/wamp_session_id.hpp:20,
from /home/user1/work/bonefish/src/bonefish/common/wamp_message_processor.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.hpp:20,
from /home/user1/work/bonefish/src/bonefish/native/native_server_impl.cpp:17:
/usr/include/c++/4.9/bits/exception_ptr.h:193:5: note: std::__exception_ptr::exception_ptr std::copy_exception(_Ex) [with _Ex = std::runtime_error]
copy_exception(_Ex __ex) _GLIBCXX_USE_NOEXCEPT
^
src/CMakeFiles/bonefish.dir/build.make:330: recipe for target 'src/CMakeFiles/bonefish.dir/bonefish/native/native_server_impl.cpp.o' failed
make[2]: *** [src/CMakeFiles/bonefish.dir/bonefish/native/native_server_impl.cpp.o] Error 1
CMakeFiles/Makefile2:125: recipe for target 'src/CMakeFiles/bonefish.dir/all' failed
make[1]: *** [src/CMakeFiles/bonefish.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

Make transports a fixture of a router

Since the original use cases for bonefish were very simple we made the specification of transports simple as well. As a result, transports are shared amongst routers. This needs to be inverted such that transports are configured on a router by router basis. As a result, transports can only be shared amongst the realms managed by a single router.

REST

Somewhat out of context - but wondering if anyone has some suggestions:

  • what is the right way to use / expose the underlying RPC endpoints as REST endpoints also?

With RPC and Pub/Sub under the same hood, the only thing left is REST capability - that way we can cover all the spectrum (of clients).

RPC is good, but demanding websocket for it to work is kind of inconvenience (as opposed to simple REST, from say CLI).

Is there anyway, this Bonefish can be extended to support REST for the underlying RPC (for example,auto-generate the REST wrappers for the RPC endpoints , something on the lines of swagger??)

Allow for disabling websocket support

In the spirit of keeping things lean, we should consider allowing a build option for compiling without websocket support. This should help to further reduce the resulting binary/library size. This would primarily be useful for embedded environments where storage constraints are of concern.

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.