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

run libzmq with pgm in win10,but abort with error #4301

Open
choujayyl opened this issue Nov 16, 2021 · 3 comments
Open

run libzmq with pgm in win10,but abort with error #4301

choujayyl opened this issue Nov 16, 2021 · 3 comments

Comments

@choujayyl
Copy link

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
Copy link
Author

choujayyl commented Nov 18, 2021

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.

@RRRaymond
Copy link

Awesome, your solution save me at least 2 days.

@jinspace
Copy link

jinspace commented Mar 7, 2024

it matters.

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

3 participants