Can someone explain to me why this code fails once in a while with a null exception for udpLink while sending?
udpLink = new UdpClient(ipAddress, 514);
using (udpLink)
{
udpLink.Send(rawMsg, rawMsg.Length);
}
This is the new code on how I fixed it.
udpLink = new UdpClient(ipAddress, 514);
using (udpLink)
{
if (udpLink != null) udpLink.Send(rawMsg, rawMsg.Length);
}
Any ideas?