Exemplo n.º 1
0
        private IpListener AddListener(IPAddress address, bool legacy)
        {
            var port     = legacy ? Protocol.LegacyPort : Protocol.DefaultPort;
            var listener = new IpListener(address, port, legacy);

            listener.ClientConnected += ClientConnected;
            return(listener.Start());
        }
Exemplo n.º 2
0
        public Listener Listen()
        {
            listenerIp4    = enableIPv4 ? AddListener(IPAddress.Any, false) : null;
            listenerIp6    = enableIPv6 ? AddListener(IPAddress.IPv6Any, false) : null;
            listenerLegacy = enableLegacy ? AddListener(IPAddress.Any, true) : null;

            return(this);
        }