You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
850 B

7 months ago
using System.Text;
using Autofac;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using Service.Charger.Msg.Host.Req;
7 months ago
namespace Service.Charger.Client;
7 months ago
/// <summary>
7 months ago
/// 示例程序
7 months ago
/// </summary>
[Scope("SingleInstance")]
public class ClientMgr
{
public void InitClient()
{
7 months ago
var auth = new Auth(1, Encoding.UTF8.GetBytes("ddddddddd"), 1);
7 months ago
auth.DestAddr = new byte[] { 0x01, 0x02, 0x03 };
7 months ago
var chargerClient2 = AppInfo.Container.Resolve<ChargerClient>();
7 months ago
chargerClient2.InitBootstrap("127.0.0.1", 9998);
chargerClient2.BaseConnect();
7 months ago
chargerClient2.SessionAttr(12, 12, "12", "2");
chargerClient2.Channel.WriteAndFlushAsync(auth);
7 months ago
var chargerServer = AppInfo.Container.Resolve<ChargerServer>();
7 months ago
chargerServer.Start(9000);
}
}