Upgrade Nuget
大石头 authored at 2024-11-20 14:03:58
840.00 B
NewLife.Remoting
using NewLife.Data;
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;
    }
}