-
Notifications
You must be signed in to change notification settings - Fork 8
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
Binding not compatible with latest nanomsg (0.8-beta) #14
Comments
Hello, I don't use nanomsg anymore, but I just reviewed things and it seems like the public interface only changed in adding a few function (nn_tcpmuxd, nn_poll, and nn_reallocmsg). So, most of the binding should still work. Try changing this line If you have some success, then I can add that change and some of the missing functions. |
Yes, I tested it and it seems to be working, I would suggest to incorporate the proposed change. I also have the following feedback / suggestions:
-- Helper function, behaves like standard assert() for nanomsg
function nn.assert(x, err)
if not x then
error(nn.strerror(err))
end
return x
end
sendstr = function(s, msg, flags)
return s:send(msg, #msg, flags)
end,
-- Needs adjustment if recv_zc is changed wrt. EAGAIN.
recvstr = function(s, flags)
local nnmsg, err = s:recv_zc(flags)
if not nnmsg then return nil, err end
local msg = nnmsg:tostring()
nnmsg:free()
return msg
end, Let me know your thoughts. |
Thinking about it a bit more, I would probably avoid the As the "error" code is returned (instead of an error string) it seems to me that this way the library code would be simplified while similar amount of code is required from the user in both scenarios to distinguish between |
Thanks for your thoughts and an pull requests that come. |
As noted here:
nanomsg/nanomsg#389 (comment)
this binding should be upgraded to the latest version of libnanomsg.
As of now, the binding does not load (the version check in the code fails).
The text was updated successfully, but these errors were encountered: