示例#1
0
 public SimpleUDPServer(int port, DatagramReceiveHandler handler, Encoding encoding)
 {
     client          = new UdpClient(port);
     localIPEndPoint = new IPEndPoint(IPAddress.Loopback, port);
     this.handler    = handler;
     this.encoding   = encoding;
 }
示例#2
0
        public SimpleTCPServer(int port, DatagramReceiveHandler handler, Encoding encoding)
        {
            endPoint = new IPEndPoint(IPAddress.Loopback, port);
            server   = new TcpListener(endPoint);

            this.handler  = handler;
            this.encoding = encoding;
        }
示例#3
0
 public SimpleTCPServer(int port, DatagramReceiveHandler handler)
     : this(port, handler, Encoding.Unicode)
 {
 }