tonysimpson / nanomsg-python

nanomsg wrapper for python with multiple backends (CPython and ctypes) should support 2/3 and Pypy
MIT License
382 stars 85 forks source link

Can not get recv_fd #64

Closed zhangxiaoxu closed 6 years ago

zhangxiaoxu commented 6 years ago

1

Always receive exception, I delete the highlight part, it works. Any update?when?

tonysimpson commented 6 years ago

Thanks, Do you know why that check is failing?

zhangxiaoxu commented 6 years ago

In x64 environment, length is 8.

tonysimpson commented 6 years ago

Should be fixed on HEAD now. Regards.

codypiersall commented 6 years ago

@ZhangXiaoxu, could you give more details about the code you were running that caused this issue? I can't reproduce it, and I think commit https://github.com/tonysimpson/nanomsg-python/commit/aed15210b2bdb68d708ec2f64e83fba8b4e3d8e1 which was in response to this issue may have broken things for 64-bit Linux and Mac.

radiocane commented 5 years ago

Indeed, I'm 64-bit Linux and commit:aed1521 raises because _INT_PACKER(str('l')).size is 8 while sizeof(int) is 4 I also question the length != size check: I'd say, if the return value is not negative, use the returned length to correctly interpret the value inside buf and be merry.