调整首页说明
智能大石头 authored at 2023-11-10 23:04:54
820.00 B
NewLife.Remoting
using NewLife.Log;
using NewLife.Net;
using NewLife.Remoting;
using NewLife.Serialization;

namespace Test;

class Program
{
    static void Main(String[] args)
    {
        XTrace.UseConsole();

        try
        {
            //TestHyperLogLog();
            Test1();
        }
        catch (Exception ex)
        {
            XTrace.WriteException(ex);
        }

        Console.WriteLine("OK!");
        Console.ReadKey();
    }

    static ApiServer _Server;
    static void Test1()
    {
        var obj = new { state = "abcd", state2 = 1234 };
        var buf = Binary.FastWrite(obj);
        var str = buf.ToHex();

        var server = new ApiServer(5500)
        {
            Log = XTrace.Log,
            EncoderLog = XTrace.Log
        };

        server.Start();

        _Server = server;
    }
}