コード例 #1
0
        public void Initialize(IPEndPoint address, MessageHandler[] handler, ISessionFactory factory, MessageFactory[] message, bool useRijndael)
        {
            _listener      = new TcpListener(address);
            _decoder       = new WZPacketDecoder(message, useRijndael);
            _decoderSimple = new WZPacketDecoderSimple(message);
            _encoder       = new WZPacketEncoder(message, useRijndael);
            _listener.Start();
            _factory = factory;
            _handler = handler;

            Task.Run(AcceptClients);

            Logger.Information("Started on TCP-IP:{ip} TCP-PORT:{port}", address.Address, address.Port);
        }