C#网络编程之组播(JoinMulticastGroup)

bool canExecute = true;
recvClient = new UdpClient(port);
IPAddress ip = IPAddress.Parse("224.100.0.1");
try
{
recvClient.JoinMulticastGroup(ip);
}
catch (Exception ex)
{
canExecute = false;
}

 

这里抛异常是因为,组播可能需要路由支持,(检查电脑联网没,连路由没)

posted @ 2014-05-16 11:45  巩乃斯大叔  阅读(1942)  评论(0编辑  收藏  举报