Exemple #1
0
 static void Main(string[] args)
 {
     //服务器初始化
     ServerStart serverStart = new ServerStart(9000);
     serverStart.messageEncode = MessageEncoding.MessageEncode;
     serverStart.messageDecode = MessageEncoding.MessageDecode;
     serverStart.lengthEncode = LengthEncoding.Encode;
     serverStart.lengthDecode = LengthEncoding.Decode;
     serverStart.center = new HandlerCenter();
     serverStart.Start(6650);
     Console.WriteLine("服务器连接成功");
     while (true) { }
 }
Exemple #2
0
        static void Main(string[] args)
        {
            ServerStart ss = new NetFrame.ServerStart(123);

            ss.encode = MessageEncoding.encode;
            ss.center = new HandlerCenter();
            ss.decode = MessageEncoding.decode;
            ss.LD     = LengthEncoding.decode;
            ss.LE     = LengthEncoding.encode;

            ss.Start(1234);
            Console.WriteLine("服务器启动成功");
            while (true)
            {
            }
        }