bool canExecute = true;
recvClient = new UdpClient(port);
IPAddress ip = IPAddress.Parse("224.100.0.1");
try
{
recvClient.JoinMulticastGroup(ip);
}
catch (Exception ex)
{
canExecute = false;
}
这里抛异常是因为,组播可能需要路由支持,(检查电脑联网没,连路由没)
本文讨论了使用UDP客户端进行组播时遇到的异常情况,并解释了可能的原因及解决办法,包括检查电脑是否联网及路由配置。
bool canExecute = true;
recvClient = new UdpClient(port);
IPAddress ip = IPAddress.Parse("224.100.0.1");
try
{
recvClient.JoinMulticastGroup(ip);
}
catch (Exception ex)
{
canExecute = false;
}
这里抛异常是因为,组播可能需要路由支持,(检查电脑联网没,连路由没)
转载于:https://www.cnblogs.com/gnsds/p/3731849.html
949

被折叠的 条评论
为什么被折叠?
