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