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

Expose a read/receive method without NN_MSG option #57

Open
blabaere opened this issue Nov 14, 2014 · 4 comments
Open

Expose a read/receive method without NN_MSG option #57

blabaere opened this issue Nov 14, 2014 · 4 comments

Comments

@blabaere
Copy link
Collaborator

Is there a way to provide nn_recv the native buffer used by a Vec[u8], to avoid the copy ?

@thehydroimpulse
Copy link
Owner

Yeah, that would be ideal. Nanomsg also supports true zero-copy.

@blabaere
Copy link
Collaborator Author

In fact, this should be the default behavior of the Reader trait read function. Since it is passed a mutable slice, there must be a way to tell nanomsg to use the native underlying pointer and to remove the NN_MSG option. I think now that the read_to_end function is the only right place to use NN_MSG.

@thehydroimpulse
Copy link
Owner

Agreed!

@blabaere
Copy link
Collaborator Author

This is now done as read function of Reader trait is passing the raw pointer of the slice parameter to nanomsg.

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