Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Is there a plan for supporting nn_recvmsg, nn_sendmsg in Socket class? #42

Open
gwangyi opened this issue Jan 23, 2017 · 3 comments
Open

Comments

@gwangyi
Copy link

gwangyi commented Jan 23, 2017

I want to implement async rep/req pattern, but there's no nn_recvmsg/nn_sendmsg supports in nnpy.

In my understanding, async rep/req needs AF_SP_RAW socket and nn_recvmsg/nn_sendmsg with nn_msghdr::msg_control field.

Do you have any plan about supporting nn_recvmsg/nn_sendmsg?

@djc
Copy link
Member

djc commented Jan 24, 2017

I'm not sure what you need the msg_control for, from what I know just using AF_SP_RAW should be sufficient. Why do you think you need it?

There are no current plans, but I'd be open to adding this. Particularly if you can contribute code changes. ;)

@gwangyi
Copy link
Author

gwangyi commented Jan 24, 2017

I found the example of async rep/req pattern at nanomsg/demo/async_demo.c. In this example, it creates REP socket with with AF_SP_RAW and stores msg_control which is gained from nn_recvmsg. After that, by using nn_sendmsg with stored msg_control, it replies to each associated REQ socket with out of order.

I am a novice about nanomsg, so there can be another implementation of async REP/REQ pattern, but I couldn't find them out.

@djc
Copy link
Member

djc commented Jan 25, 2017

My hypothesis is that, if you use AF_SP_RAW with the normal messaging APIs, you might not need this handling of the control flag. Maybe you should try that first.

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

No branches or pull requests

2 participants