Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems HostMetaApiService does not work for method (topic) registration #110

Closed
nj4x opened this issue Nov 27, 2015 · 11 comments
Closed

Seems HostMetaApiService does not work for method (topic) registration #110

nj4x opened this issue Nov 27, 2015 · 11 comments

Comments

@nj4x
Copy link

nj4x commented Nov 27, 2015

Hello, Elad.

Please use this gist: https://gist.github.com/nj4x/dab94f833ca1e973623b to reproduce my case.

(WampSharp 1.2.4.111-dev)

@darkl
Copy link
Member

darkl commented Nov 27, 2015

Hi Roman,

This seems to work fine with Json serialization but doesn't work with msgpack serialization. I think it is related to the way I serialize DateTime in Newtonsoft.Msgpack.

I will try to investigate this further during the weekend.

Elad

@darkl
Copy link
Member

darkl commented Nov 28, 2015

Ok - the problem is that Newtonsoft.Msgpack serializes DateTime as a number (like msgpack-cli does) and after that WampSharp deserializes the object first into a JToken and later to a RegistrationDetails, but now when JTokenReader occurs a number, it doesn't attempt to convert it into a DateTime.

It seems that crossbar sends DateTime as a string, which is less compact but seems more compatible (other WAMP implementations might not know how to convert a number to a DateTime). I guess we should add an option to Newtonsoft.Msgpack MessagePackReader to write DateTime as string and use it in WampSharp.

Elad

@nj4x
Copy link
Author

nj4x commented Nov 28, 2015

Ok, I've removed MsgpackSerialization from that example and put JsonSerialization instead. Now it does not work (RPC un-register) when using RawSocketTransport (for Callee) instead of WebSocketTransport: https://gist.github.com/nj4x/92c118ed9ca57461755a

@darkl
Copy link
Member

darkl commented Nov 28, 2015

Hi,

I'm not sure why the router doesn't detect the client disconnection. Adding auto-pings eventually fixes this. (Set the autoPingInterval of the RawSocketTransport)

I'm not sure why an exception doesn't occur on the router side when the client disconnects without this.

Elad

@darkl darkl closed this as completed Nov 28, 2015
@darkl darkl reopened this Nov 28, 2015
@nj4x
Copy link
Author

nj4x commented Nov 28, 2015

Added AutoPing(TimeSpan.FromSeconds(2)) - did not help. Subsequent RPC registrations also does not work:
.. Main ..
CheckRegistrationEvent();
CheckRegistrationEvent();

@darkl
Copy link
Member

darkl commented Nov 28, 2015

Yeah, that's because you need to add to router side (so the router will detect disconnection):

defaultWampHost.RegisterTransport(new RawSocketTransport(new TcpListener(8090), autoPingInterval: TimeSpan.FromSeconds(20)), new JTokenJsonBinding(), new JTokenMsgpackBinding());

@darkl
Copy link
Member

darkl commented Nov 28, 2015

Ok, got it - ReadAsync returns 0 if the end of the stream has been reached. Will try to fix this.

@darkl
Copy link
Member

darkl commented Nov 28, 2015

Hi Roman,

Just released a new version to MyGet with a fix. Should work also without auto-pings :)

Elad

@nj4x
Copy link
Author

nj4x commented Nov 28, 2015

Thanks, Elad.

MetaApiService works on RawSocketTransport/JsonSerialization now.

On Sat, 28 Nov 2015 at 18:11 Elad Zelingher [email protected]
wrote:

Hi Roman,

Just released a new version to MyGet with a fix. Should work also without
auto-pings :)

Elad


Reply to this email directly or view it on GitHub
#110 (comment)
.

@darkl
Copy link
Member

darkl commented Nov 30, 2015

Hi Roman,
I released today a version of Newtonsoft.Msgpack with a fix, and a version of WampSharp to MyGet feed. Should work now also with MsgPack serialization.

Elad

@nj4x
Copy link
Author

nj4x commented Nov 30, 2015

Thank you very much, Elad.
It works like expected.

On Mon, 30 Nov 2015 at 14:39 Elad Zelingher [email protected]
wrote:

Hi Roman,
I released today a version of Newtonsoft.Msgpack with a fix, and a version
of WampSharp to MyGet feed. Should work now also with MsgPack serialization.

Elad


Reply to this email directly or view it on GitHub
#110 (comment)
.

@darkl darkl closed this as completed Dec 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants