libzmq icon indicating copy to clipboard operation
libzmq copied to clipboard

run libzmq with pgm in win10,but abort with error

Open choujayyl opened this issue 3 years ago • 3 comments

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

  1. `#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.

choujayyl avatar Nov 16 '21 09:11 choujayyl

image

I found reason,because openPGM use setsockopt with SOL_IP option.That indicate Invaild parameter。You must use IPPROTO_IP. But I dont understand.

choujayyl avatar Nov 18 '21 02:11 choujayyl

Awesome, your solution save me at least 2 days.

RRRaymond avatar Oct 17 '23 07:10 RRRaymond

it matters.

jinspace avatar Mar 07 '24 02:03 jinspace