Tag: multicast

联网计算机未收到多播

我正在尝试向所有网络计算机发送多播。 我在计算机上安装了服务器,在网络上安装了另一台计算机。 当我发出多播消息时,在我的计算机上运行的服务器可以很好地发送它。 网络计算机虽然没有得到任何东西。 我已经尝试将TTL设置为其最大值,但没有做任何事情。 我也尝试使用WireShark监控我的数据包,但没有看到任何东西(我对此并不熟悉)。 我很困惑为什么我的电脑收到它,而不是其他联网的电脑。 这是我用来发送多播的代码: #include /* for type definitions */ #include /* for win socket API calls */ #include /* for win socket structs */ #include /* for printf() */ #include /* for atoi() */ #include /* for strlen() */ #define MAX_LEN 1024 /* maximum string size to send */ #define […]

调用setsockopt时出错“No such device”

我有一个代码,其中发送多播数据报。 一段重要的代码: uint32_t port; int sockfd, err_ip; const uint32_t sizebuff = 65535 – (20 + 8); unsigned char *buff = (unsigned char *) malloc(sizebuff); struct sockaddr_in servaddr, cliaddr; struct in_addr serv_in_addr; struct ip_mreq req; port = str2uint16(cmdsrv->ipport); bzero(buff, (size_t)sizebuff); bzero(&servaddr, sizeof(servaddr)); bzero(&serv_in_addr, sizeof(serv_in_addr)); err_ip = inet_aton(cmdsrv->ipaddr, &serv_in_addr); if(( err_ip != 0 ) && ( port […]

以上内核中的Python Netlink多播通信

我试图在4(4.1)以上的内核上重现先前SOpost中的示例: #include #include #include #include #include /* Protocol family, consistent in both kernel prog and user prog. */ #define MYPROTO NETLINK_USERSOCK /* Multicast group, consistent in both kernel prog and user prog. */ #define MYGRP 31 static struct sock *nl_sk = NULL; static void send_to_user(void) { struct sk_buff *skb; struct nlmsghdr *nlh; char *msg = […]