Socket error shown.
public Communicator(IPAddress toconnectto)
{
this.toconnectto = new IPEndPoint(toconnectto, port);
local = new IPEndPoint(Tools.GetIp(), port);
all = new IPEndPoint(IPAddress.Any, port);
udpClient = new UdpClient(AddressFamily.InterNetwork);
udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
udpClient.AllowNatTraversal(true);
udpClient.EnableBroadcast = true;
}
public void SendData(string data)
{
try
{
byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
udpClient.Send(bdata,bdata.Length,toconnectto);
}
catch(Exception ex)
{
;
}
}
public Communicator(IPAddress toconnectto)
{
this.toconnectto = new IPEndPoint(toconnectto, port);
local = new IPEndPoint(Tools.GetIp(), port);
all = new IPEndPoint(IPAddress.Any, port);
udpClient = new UdpClient(AddressFamily.InterNetwork);
udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
udpClient.AllowNatTraversal(true);
udpClient.EnableBroadcast = true;
}
public void SendData(string data)
{
try
{
byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
udpClient.Send(bdata,bdata.Length,toconnectto);
}
catch(Exception ex)
{
;
}
} public Communicator(IPAddress toconnectto)
{
this.toconnectto = new IPEndPoint(toconnectto, port);
local = new IPEndPoint(Tools.GetIp(), port);
all = new IPEndPoint(IPAddress.Any, port);
udpClient = new UdpClient(AddressFamily.InterNetwork);
udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
udpClient.AllowNatTraversal(true);
udpClient.EnableBroadcast = true;
}
public void SendData(string data)
{
try
{
byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
udpClient.Send(bdata,bdata.Length,toconnectto);
}
catch(Exception ex)
{
;
}
} public Communicator(IPAddress toconnectto)
{
this.toconnectto = new IPEndPoint(toconnectto, port);
local = new IPEndPoint(Tools.GetIp(), port);
all = new IPEndPoint(IPAddress.Any, port);
udpClient = new UdpClient(AddressFamily.InterNetwork);
udpClient.Client.Bind(new IPEndPoint(Tools.GetIp(), port));
udpClient.AllowNatTraversal(true);
udpClient.EnableBroadcast = true;
}
public void SendData(string data)
{
try
{
byte[] bdata = ASCIIEncoding.ASCII.GetBytes(data);
udpClient.Send(bdata,bdata.Length,toconnectto);
}
catch(Exception ex)
{
;
}
}