Conectar dois clientes UDP a uma porta (Enviar e Receber)
Eu tentei a sugestão deessa questã com muito pouco sucesso.
Por favor ... qualquer ajuda será muito apreciada!
Aqui está o meu código:
static void Main(string[] args)
{
IPEndPoint localpt = new IPEndPoint(IPAddress.Any, 6000);
UdpClient udpServer = new UdpClient(localpt);
udpServer.Client.SetSocketOption(
SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
UdpClient udpServer2 = new UdpClient();
udpServer2.Client.SetSocketOption(
SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
udpServer2.Client.Bind(localpt); // <<---------- Exception here
}