コード例 #1
0
 public SocketServerControl()
 {
     appServer   = new MyServer();
     superConfig = new SuperSocketConfig();
     clientList  = new List <Client>();
     deviceList  = new List <Device>();
 }
コード例 #2
0
        /// <summary>
        /// 启动socket 监听
        /// </summary>
        public static void StartServer()
        {
            appServer   = new MyServer();
            superConfig = new SuperSocketConfig();
            //Setup the appServer
            if (!appServer.Setup(1001)) //Setup with listening port
            {
                LogHelper.Log.Info("Failed to setup!");
                return;
            }

            //Try to start the appServer
            if (!appServer.Start())
            {
                LogHelper.Log.Info("Failed to start!");
                return;
            }
            appServer.NewSessionConnected += MyServer_NewSessionConnected;
            appServer.SessionClosed       += MyServer_SessionClosed;

            LogHelper.Log.Info("SuperSocket Server Start Success.....");
        }
コード例 #3
0
 public SocketServerBinary()
 {
     appServer   = new MyServer();
     superConfig = new SuperSocketConfig();
 }