Exemplo n.º 1
0
 public UDPServer(UDPAddress udpAddress, UDPMsgService owner)
 {
     try
     {
         this.owner = owner;
         this.udpAddress = udpAddress;
         serverThread = new Thread(new ThreadStart(StartReceive));
         serverThread.Start();
         Console.WriteLine("UDPServer thread started for " + udpAddress);
     }
     catch (Exception e)
     {
         Console.WriteLine("An UDP Exception has occurred!" + e.ToString());
         serverThread.Abort();
     }
 }
Exemplo n.º 2
0
 public UDPClient(UDPAddress udpAddress)
 {
     this.udpAddress = udpAddress;
     connect();
 }
Exemplo n.º 3
0
            public UDPMsgService(UDPAddress[] local, UDPAddress[] remote)
                : base()
            {
                this.local = local;
                this.remote = remote;

                if (local != null)
                {
                    serverCount = local.Length;
                    udpServers = new UDPServer[serverCount];
                }
                if (remote != null)
                {
                    clientCount = remote.Length;
                    udpClients = new UDPClient[clientCount];
                }
            }