Пример #1
0
        static void Main(string[] args)
        {
            string ip   = "127.0.0.1";
            ushort port = 20011;

            API = new GateServer();
            try
            {
                API.Init(ip, port);
                API.ReConnect();
            }
            catch (Exception e)
            {
                Console.WriteLine("init failed:{0}", e.ToString());
                API.Exit();
                return;
            }

            Thread workThread = new Thread(ThreadMethod);

            workThread.Start();
            Console.WriteLine("client is ready...");
            while (true)
            {
                string cmd = Console.ReadLine().ToLower().Trim();
                switch (cmd)
                {
                case "send":
                    API.Request_Test();
                    break;

                default:
                    break;
                }
            }
            //Console.ReadLine();
        }
Пример #2
0
 public Api()
 {
     _api = new GateServer();
 }