public void Send()
{
var msg = Encoding.ASCII.GetBytes(Message);
try {
var client = new UdpClient();
client.Client.Bind(new IPEndPoint(LocalAddress, 0));
client.BeginSend(msg, msg.Length, EndPoint, result =>
{
try {
client.EndSend(result);
}
catch (Exception ex) {
Debug(ex);
}
finally {
try {
client.Close();
}
catch (Exception) {
}
}
}, null);
}
catch (Exception ex) {
Error(ex);
}
++SendCount;
}