Problematic default WampOptions in AutobahnAndroid

#1

Hi,

I was just updating some code, and came across an issue.

When using custom WampOptions in the connect method, the default WampOptions constructor, which equals to WebSocketOptions, initializes the variable mReceiveTextMessageRaw to false.

The usage of Wamp requires this variable to be set to true. I was getting a WebSocketException labeled “non-raw receive of text message”, which dissapeared when I used

WampOptions wo = new WampOptions();
wo.setReceiveTextMessagesRaw(true); <-------- this call
m_acAutobahn.connect(“ws://…:20001”, new Wamp.ConnectionHandler() {…}, wo);

I suggest modifying the WampOptions constructor to override the default setting of WebSocketOptions. I don’t know if this has consequences to the samples in the Demo folder, but it might be worth checking if they still work if they get custom WampOptions (like a modified reconnect timeout) without a call to setReceiveTextMessagesRaw.

Kind regards,
Daniel

0 Likes

#2

Making the Wamp ctor set the raw option: yep, thats how it should be … if its not thats a bug. I have a look tomorrow …

···

Am 09.03.2013 11:52 schrieb “Daniel F.” sound...@gmail.com:

Hi,

I was just updating some code, and came across an issue.

When using custom WampOptions in the connect method, the default WampOptions constructor, which equals to WebSocketOptions, initializes the variable mReceiveTextMessageRaw to false.

The usage of Wamp requires this variable to be set to true. I was getting a WebSocketException labeled “non-raw receive of text message”, which dissapeared when I used

WampOptions wo = new WampOptions();

wo.setReceiveTextMessagesRaw(true); <-------- this call
m_acAutobahn.connect(“ws://…:20001”, new Wamp.ConnectionHandler() {…}, wo);

I suggest modifying the WampOptions constructor to override the default setting of WebSocketOptions. I don’t know if this has consequences to the samples in the Demo folder, but it might be worth checking if they still work if they get custom WampOptions (like a modified reconnect timeout) without a call to setReceiveTextMessagesRaw.

Kind regards,
Daniel

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

0 Likes