"Hello world!" example Cpp application not working with Crossbar 0.10.4

99 views
Skip to first unread message

François Guertin

unread,
Jun 10, 2015, 2:15:27 PM6/10/15
to autob...@googlegroups.com
Hi all,

I've been using Crossbar (v0.10.3) and AutobahnCpp for a while and then I decided to give CppWAMP a trial since many of the advanced features the other Autobahn implementations (Python and JS) are simply not provided in the Cpp one :-(

So, after cloning CppWAMP and installing Boost 1.58, I was able to build the CppWAMP Chat sample program. But there was an issue when it tried to connect to router. The rawsocket connection falied because the message length has exceeded !!! I then realized someone had the same problem. This was easily fixed by upgrading Crossbar to its latest version (which is v0.10.4).

fguertin@BBBRTH5DEV01:~/Crossbar_hello_Cpp_original$ crossbar version

Crossbar.io package versions and platform information:

Crossbar.io                  : 0.10.4

  Autobahn|Python            : 0.10.4
    WebSocket UTF8 Validator : wsaccel-0.6.2
    WebSocket XOR Masker     : wsaccel-0.6.2
    WAMP JSON Codec          : ujson-1.33
    WAMP MsgPack Codec       : msgpack-python-0.4.2
  Twisted                    : 15.2.1-EPollReactor
  Python                     : 2.7.6-CPython

OS                           : Linux-3.13.0-52-generic-i686-with-Ubuntu-14.04-trusty
Machine                      : i686

I then decided to verify and make sure that the AutobahnCpp hello sample could still work under Crossbar v0.10.4.
I followed the getting started instructions to build the hello sample program (using crossbar init --template hello:cpp --appdir $HOME/Crossbar_hello_Cpp).

But right after starting Crossbar, the router launched the hello program (as a guest worker) and just after the connection was made, the router caught an unhandled exception (see log trace below).

fguertin@BBBRTH5DEV01:~/Crossbar_hello_Cpp$ crossbar start
Stale Crossbar.io PID file /home/fguertin/Crossbar_hello_Cpp/.crossbar/node.pid (pointing to non-existing process with PID 21716) removed
2015-06-10 12:25:08-0400 [Controller  21899] Log opened.
2015-06-10 12:25:08-0400 [Controller  21899] ==================== Crossbar.io ====================
2015-06-10 12:25:08-0400 [Controller  21899] Crossbar.io 0.10.4 starting
2015-06-10 12:25:08-0400 [Controller  21899] Running on CPython using EPollReactor reactor
2015-06-10 12:25:08-0400 [Controller  21899] Starting from node directory /home/fguertin/Crossbar_hello_Cpp/.crossbar
2015-06-10 12:25:08-0400 [Controller  21899] Starting from local configuration '/home/fguertin/Crossbar_hello_Cpp/.crossbar/config.json'
2015-06-10 12:25:08-0400 [Controller  21899] Router created for realm 'crossbar'
2015-06-10 12:25:08-0400 [Controller  21899] No WAMPlets detected in enviroment.
2015-06-10 12:25:09-0400 [Controller  21899] Starting Router with ID 'worker1' ..
2015-06-10 12:25:09-0400 [Controller  21899] Entering reactor event loop ...
2015-06-10 12:25:09-0400 [Router      21904] Log opened.
2015-06-10 12:25:09-0400 [Router      21904] Running under CPython using EPollReactor reactor
2015-06-10 12:25:10-0400 [Router      21904] Entering event loop ..
2015-06-10 12:25:10-0400 [Controller  21899] Router with ID 'worker1' and PID 21904 started
2015-06-10 12:25:10-0400 [Controller  21899] Router 'worker1': realm 'realm1' (named 'realm1') started
2015-06-10 12:25:10-0400 [Controller  21899] Router 'worker1': role 'role1' (named 'anonymous') started on realm 'realm1'
2015-06-10 12:25:10-0400 [Router      21904] Site starting on 8080
2015-06-10 12:25:10-0400 [Controller  21899] Router 'worker1': transport 'transport1' started
2015-06-10 12:25:10-0400 [Router      21904] CrossbarWampRawSocketServerFactory starting on 8090
2015-06-10 12:25:10-0400 [Controller  21899] Router 'worker1': transport 'transport2' started
2015-06-10 12:25:10-0400 [Controller  21899] Using guest worker executable '/home/fguertin/Crossbar_hello_Cpp/hello' (executable path taken from configuration)
2015-06-10 12:25:10-0400 [Controller  21899] Starting Guest with ID 'worker2' ..
2015-06-10 12:25:10-0400 [Controller  21899] Guest with ID 'worker2' and PID 21909 started
2015-06-10 12:25:10-0400 [Controller  21899] Guest 'worker2': started
2015-06-10 12:25:10-0400 [Guest       21909] Running on 105600
2015-06-10 12:25:10-0400 [Guest       21909] Starting ASIO I/O loop ..
2015-06-10 12:25:10-0400 [Guest       21909] Connected to server
2015-06-10 12:25:10-0400 [Router      21904] Unhandled Error
2015-06-10 12:25:10-0400 [Router      21904] Traceback (most recent call last):
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/twisted/python/log.py", line 101, in callWithLogger
2015-06-10 12:25:10-0400 [Router      21904] return callWithContext({"system": lp}, func, *args, **kw)
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/twisted/python/log.py", line 84, in callWithContext
2015-06-10 12:25:10-0400 [Router      21904] return context.call({ILogContext: newCtx}, func, *args, **kw)
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
2015-06-10 12:25:10-0400 [Router      21904] return self.currentContext().callWithContext(ctx, func, *args, **kw)
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
2015-06-10 12:25:10-0400 [Router      21904] return func(*args,**kw)
2015-06-10 12:25:10-0400 [Router      21904] --- <exception caught here> ---
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 611, in _doReadOrWrite
2015-06-10 12:25:10-0400 [Router      21904] why = selectable.doRead()
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 209, in doRead
2015-06-10 12:25:10-0400 [Router      21904] return self._dataReceived(data)
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 215, in _dataReceived
2015-06-10 12:25:10-0400 [Router      21904] rval = self.protocol.dataReceived(data)
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/autobahn/twisted/rawsocket.py", line 201, in dataReceived
2015-06-10 12:25:10-0400 [Router      21904] self.abort()
2015-06-10 12:25:10-0400 [Router      21904] File "/usr/local/lib/python2.7/dist-packages/autobahn/twisted/rawsocket.py", line 177, in abort
2015-06-10 12:25:10-0400 [Router      21904] raise TransportLost()
2015-06-10 12:25:10-0400 [Router      21904] autobahn.wamp.exception.TransportLost:
2015-06-10 12:25:10-0400 [Guest       21909] ASIO I/O loop ended

What has changed from Crossbar v0.10.3 that causes this exception? 
Did I forgot to update something?

Any help would be appreciated.

Regards,
Francois.
Reply all
Reply to author
Forward
0 new messages