예제 #1
0
 public ClientUdp()
 {
     client                    = new SimpleUdpClient(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 0), new IPEndPoint(IPAddress.Parse("127.0.0.1"), 11001));
     client.OnException       += Client_OnException;
     client.OnMessageReceived += Client_OnMessageReceived;
     client.Start();
 }
예제 #2
0
 public ServerUdp()
 {
     server = new SimpleUdpClient(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 11001));
     server.OnMessageReceived += Server_OnMessageReceived;
     server.OnException       += Server_OnException;
     server.Start();
 }
예제 #3
0
        public static SimpleUdpLog Create(string ipaddr, string logger)
        {
            if (!clients.ContainsKey(ipaddr))
            {
                var temp = new SimpleUdpClient();
                temp.Create(ipaddr, port);
                clients.Add(ipaddr, temp);
            }
            var client = clients[ipaddr];

            return(new SimpleUdpLog(client, logger));
        }