libzmq
libzmq copied to clipboard
run libzmq with pgm in win10,but abort with error
Issue description
run libzmq with openpgm in win10,but abort with error·。
Error: Join multicast group { .gr_interface = 0, .gr_group = "224.0.22.1" } failed: Invalid argument.(10022) Invalid argument (G:\dev\2021\daspnetsrv2\testPGM\lib\src\zeromq-4.3.3\src\session_base.cpp:734)
Environment
- libzmq version (commit hash if unreleased): 4.3.4
- OS: win10
- openpgm v5.2.128
Minimal test code / Steps to reproduce the issue
-
`#include <string.h> #include <windows.h> #include <zmq.h> int main() { int index = 0; int count = -1; char buf[128]; void* context = zmq_ctx_new(); void* socket = zmq_socket(context, ZMQ_SUB); zmq_setsockopt(socket, ZMQ_SUBSCRIBE, "", 0); int rc = zmq_connect(socket, "epgm://224.0.22.1:9210"); if (rc != 0) { printf("zmq_errno() is %d,:%s\n", zmq_errno(),zmq_strerror(zmq_errno())); return -1; }
while (1) { sprintf_s(buf, sizeof(buf),"%d -- SERVER MSG!", index++); count = zmq_send(socket, buf, strlen(buf), 0); printf("%s (%d)\r\n", buf, count); Sleep(1000); }
zmq_close(socket); zmq_ctx_destroy(context); return 0; } `
What's the actual result? (include assertion message & call stack if applicable)
Error: Join multicast group { .gr_interface = 0, .gr_group = "224.0.22.1" } failed: Invalid argument.(10022) Invalid argument (G:\dev\2021\daspnetsrv2\testPGM\lib\src\zeromq-4.3.3\src\session_base.cpp:734)
What's the expected result?
No error.
I found reason,because openPGM use setsockopt with SOL_IP option.That indicate Invaild parameter。You must use IPPROTO_IP. But I dont understand.
Awesome, your solution save me at least 2 days.
it matters.