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

Can't switch between pair version 0 and 1 #71

Closed
JenWa opened this issue Jan 20, 2020 · 1 comment
Closed

Can't switch between pair version 0 and 1 #71

JenWa opened this issue Jan 20, 2020 · 1 comment

Comments

@JenWa
Copy link

JenWa commented Jan 20, 2020

Hello,

first of all thank you for this project!

I have two projects which use nanomsg for ipc communication (one in Go and the other in Typescript) and now I want to have a third project in C# which uses NNG (this project) to communicate with the other ones.
The Req/Rep pattern works perfectly. I have some difficulties with the Pair pattern:

When I communicate with pair sockets created by NNG everything is fine. Same for pair sockets created by nanomsg.
But if one pair socket is created by nanomsg, and I try to listen or send messages to the pair socket created by NNG (and vice versa), it doesn't work.

I found out that NNG supports a pair version 1 protocol, which nanomsg doesn't (mangos v2) and looking at your code, it seems like the issue could be that you just expose creating pair sockets with version 1 protocol ?

<Factory.cs>
public NngResult<IPairSocket> PairOpen() => Pair1Socket.Open();

I didn't find a way to call Pair0Socket.Open();

It would be awesome to also have the option to create pair sockets which use the version 0 protocol so that the interoperability between NNG and nanomsg is granted.

Thank you for any reply in advance!

@jeikabu
Copy link
Owner

jeikabu commented Jan 21, 2020

Yeah, we definitely want pair 0 support.

The intention was to create different factories that expose the various versions of the sockets similar to what's done in our Rust wrapper. Basically, create another implementation of IAPIFactory where PairOpen() returns a pair0 instead of pair1.

I'll accept the (much appreciated) PR and create an issue to flesh it out later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants