Example #1
0
        public void Start()
        {
            _netServer.Initialize();
            _netServer.OnConnected    += OnConnected;
            _netServer.OnDisconnected += OnDisconnected;
            _netServer.OnTimeout      += OnTimeout;
            _netServer.OnReceived     += OnReceived;
            var servicePortStr = System.Configuration.ConfigurationManager.AppSettings["servicePort"];
            var maxClientStr   = System.Configuration.ConfigurationManager.AppSettings["maxClient"];
            int port           = int.Parse(servicePortStr);
            int maxClient      = int.Parse(maxClientStr);

            _netServer.AddListener((ushort)port, maxClient);
            Log.Debug(typeof(Program), $"Starting Server in port: {port}");
            Log.Debug(typeof(Program), $"ApiUrl: {_apiUrl}");
        }