-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add UDP group #480
base: master
Are you sure you want to change the base?
Add UDP group #480
Conversation
add UDP group IPV4 & IPV6 join group, leave group.
mreq.imr_interface.s_addr = inet_addr(local_host); | ||
return setsockopt(sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, (const char*)&mreq, sizeof(mreq)); | ||
} | ||
HV_INLINE int udp_joingroupv6(int sockfd, const char* group, ULONG interface) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ULONG是windows平台下特有的类型定义,其它平台没有,CI已经报错了
} | ||
|
||
// join group | ||
int joinGroup(const char* g){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看了下,就添加了joinGroup、leaveGroup两个方法,其它代码都是拷贝自UdpServer,不如直接加在UdpServer里,没必要单独搞个UdpGroup类了吧
这个确实是在UdpServer的基础上添加了joinGroup、leaveGroup两个方法。但是我觉得对于UDP组播来说,接收的不一定是要做为服务器存在,可能它只是建立通道要接收数据,处理并执行,而不是向服务器一样处理后再将数据送出去。 |
现在的IPV6组播在linux和mac/ios上没有通过编译,我也用不到,想把它去掉 |
add UDP group IPV4 & IPV6 join group, leave group.