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
846 B

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