コード例 #1
0
        static void Main(string[] args)
        {
            LogAction.LogOut += LogAction_LogOut;

            CloudServer tmp = new CloudServer(1024 * 1024);//没个SocketAsync对象缓冲区128k,最大能接收1M长度的数据包

            tmp.Install(typeof(PackHandler));
            tmp.Start();
            while (true)
            {
                Console.ReadLine();
            }
        }
コード例 #2
0
        public void Start(bool isLog)
        {
            void SetLog(ILoggerFactory log)
            {
                if (isLog)
                {
                    log.AddConsole(LogLevel.Trace);
                }
            };

            cloudServer = new ServBuilder().ConfigureLogSet(null, SetLog).ConfigureServHostAndPort(p => p.Port = 9557).ConfigureBufferSize(p => p.MaxPackSize = 8 * 1024 * 1024).Bulid();
            cloudServer.Install(typeof(ServerPackHandler));
            cloudServer.Start();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: 12345fish/ZYNet
        static void Main(string[] args)
        {
            LogAction.LogOut += LogAction_LogOut;
            CloudServer tmp = new CloudServer("any", 2285, 1000, 1024 * 128, 1024 * 1024);//没个SocketAsync对象缓冲区128k,最大能接收1M长度的数据包

            tmp.Install(typeof(PackHandler));
            tmp.Start();
            while (true)
            {
                string msg = Console.ReadLine();

                foreach (var item in PackHandler.UserList)
                {
                    item.token.Get <IClientPacker>().Message(msg);
                }
            }
        }
コード例 #4
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            LogAction.LogOut      += LogAction_LogOut;
            CloudServer tmp = new CloudServer("any", 2285, 1000, 1024 * 128, 1024 * 1024);//没个SocketAsync对象缓冲区128k,最大能接收1M长度的数据包

            tmp.Install(typeof(PackHandler));
            tmp.Start();
            while (true)
            {
                string msg = Console.ReadLine();

                foreach (var item in PackHandler.UserList)
                {
                    item.token.CV(3001, msg);
                }
            }
        }