コード例 #1
0
        //---------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ServerSuperSocket.init()");

            var settings = EsEngine.Instance.Settings;

            EbLog.Note("ListenIp=" + settings.ListenIp + " ListenPort=" + settings.ListenPort);

            ServerConfig server_config = new ServerConfig();

            server_config.Ip   = settings.ListenIp;
            server_config.Port = settings.ListenPort;
            server_config.Mode = SocketMode.Tcp;
            server_config.MaxConnectionNumber    = 10000;
            server_config.MaxRequestLength       = 40962;
            server_config.ReceiveBufferSize      = 40962;
            server_config.DisableSessionSnapshot = true;
            server_config.SyncSend = false;
            server_config.LogAllSocketException   = true;
            server_config.LogBasicSessionActivity = true;
            server_config.KeepAliveInterval       = 5;
            server_config.KeepAliveTime           = 5;

            mServer = new SuperSocketServer(this);

            var r = mServer.Setup(server_config);

            mServer.Start();
        }
コード例 #2
0
        //---------------------------------------------------------------------
        public override void release()
        {
            if (mServer != null)
            {
                mServer.Stop();
                mServer = null;
            }

            EbLog.Note("ServerSuperSocket.release()");
        }