UDP: Listening to the same port for two different multicast streams

前端 未结 4 796
无人及你
无人及你 2021-01-01 03:16

I need to listen to 2 different multicast groups using the same port. Program A will listen from 230.0.0.1 and Program B from 23

4条回答
  •  感动是毒
    2021-01-01 03:56

    If you change

    in_addr.sin_addr.s_addr = htonl(INADDR_ANY);
    

    to

    inet_aton(, &in_addr.sin_addr.s_addr);
    

    you could have more success.

    (And if you change your program to work with getaddrinfo(), you make it future-proof.)

提交回复
热议问题