receiveString = ⑤_____________________________;
}
catch
{service.SetListBox("接收数据失败");}
}
答:①②③④⑤
2.现有一个Windows应用程序,该程序利用组播技术实现网络会议讨论。该会议使用组播组地址为224.0.0.1,通讯端口为3035。下面是完成此功能的核心代码框架,在下列选项中选择最确切的答案,将完成事件功能的代码填写完整。(10分)
A.UTF8 B GetBytes C ip D iep E ref remote
F remote
G IPAddress
H GetValue
I ASCII
J GetString
(1) 将SendToAll方法填写完整。该方法实现加入到组播组中,并向组播组发送组播消息的功能。
private void SendToAll(String strMessage)
{
UdpClient myUdpClient = new UdpClient();
IPAddress ip = IPAddress.Parse("224.0.0.1");
myUdpClient.EnableBroadcast = true;
//实例化通讯用端点
IPEndPoint iep = new IPEndPoint(ip,3035);
//加入组播组
udpClient.JoinMuticastGroup(①________________);
udpClient.Ttl = 30;
//将strMessage转换为UTF8字节数组
Byte[] bytes= Encoding.UTF8.②_______(strMessage)
try