在 c# 中,我使用的是 UdpClient.Receive 函数:
public void StartUdpListener(Object state)
{
try
{
udpServer = new UdpClient(new IPEndPoint(IPAddress.Broadcast, 1234));
}
catch (SocketException ex)
{
MessageBox.Show(ex.ErrorCode.ToString());
}
IPEndPoint remoteEndPoint = null;
receivedNotification=udpServer.Receive(ref remoteEndPoint);
...
但是我收到一个套接字异常,说该地址不可用,错误代码为 10049 我该怎么做才能否定这个异常?