public void Test2() { IJT808TcpSessionService jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808TcpSessionService>(); var result1 = jT808SessionServiceDefaultImpl.GetAll(); var result2 = jT808SessionServiceDefaultImpl.RemoveByTerminalPhoneNo("123456789001"); var result3 = jT808SessionServiceDefaultImpl.GetAll(); }
public void Test1() { IJT808TcpSessionService jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808TcpSessionService>(); var result = jT808SessionServiceDefaultImpl.GetAll(); Thread.Sleep(5000); }
/// <summary> /// 统一的一套注入 /// </summary> /// <param name="jT808TcpAtomicCounterService"></param> /// <param name="jT808UdpAtomicCounterService"></param> public JT808MsgIdDefaultWebApiHandler( JT808SimpleSystemCollectService jT808SimpleSystemCollectService, JT808TrafficServiceFactory jT808TrafficServiceFactory, IJT808UnificationTcpSendService jT808UnificationTcpSendService, IJT808UnificationUdpSendService jT808UnificationUdpSendService, IJT808TcpSessionService jT808TcpSessionService, IJT808UdpSessionService jT808UdpSessionService, JT808TransmitAddressFilterService jT808TransmitAddressFilterService, JT808AtomicCounterServiceFactory jT808AtomicCounterServiceFactory ) { this.jT808SimpleSystemCollectService = jT808SimpleSystemCollectService; this.jT808TcpTrafficService = jT808TrafficServiceFactory.Create(JT808ModeType.Tcp); this.jT808UdpTrafficService = jT808TrafficServiceFactory.Create(JT808ModeType.Udp); this.jT808UdpSessionService = jT808UdpSessionService; this.jT808UnificationTcpSendService = jT808UnificationTcpSendService; this.jT808UnificationUdpSendService = jT808UnificationUdpSendService; this.jT808TcpSessionService = jT808TcpSessionService; this.jT808TransmitAddressFilterService = jT808TransmitAddressFilterService; this.jT808TcpAtomicCounterService = jT808AtomicCounterServiceFactory.Create(JT808ModeType.Tcp); this.jT808UdpAtomicCounterService = jT808AtomicCounterServiceFactory.Create(JT808ModeType.Udp); InitCommonRoute(); InitTcpRoute(); InitUdpRoute(); }
public void Test3() { // 判断通道是否关闭 IJT808TcpSessionService jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808TcpSessionService>(); JT808TcpSessionManager jT808TcpSessionManager = ServiceProvider.GetService <JT808TcpSessionManager>(); var result1 = jT808SessionServiceDefaultImpl.GetAll(); SimpleTcpClient1.Down(); Thread.Sleep(5000); var session = jT808TcpSessionManager.GetSession("123456789001"); Thread.Sleep(100000); }
/// <summary> /// TCP一套注入 /// </summary> /// <param name="jT808TcpAtomicCounterService"></param> public JT808MsgIdDefaultWebApiHandler( JT808SimpleSystemCollectService jT808SimpleSystemCollectService, JT808TcpTrafficService jT808TcpTrafficService, IJT808UnificationTcpSendService jT808UnificationTcpSendService, IJT808TcpSessionService jT808TcpSessionService, JT808TransmitAddressFilterService jT808TransmitAddressFilterService, JT808TcpAtomicCounterService jT808TcpAtomicCounterService ) { this.jT808SimpleSystemCollectService = jT808SimpleSystemCollectService; this.jT808TcpTrafficService = jT808TcpTrafficService; this.jT808UnificationTcpSendService = jT808UnificationTcpSendService; this.jT808TcpSessionService = jT808TcpSessionService; this.jT808TransmitAddressFilterService = jT808TransmitAddressFilterService; this.jT808TcpAtomicCounterService = jT808TcpAtomicCounterService; InitCommonRoute(); InitTcpRoute(); }
public void Test1() { jT808SessionServiceDefaultImpl = ServiceProvider.GetService <IJT808TcpSessionService>(); jT808UnificationTcpSendService = ServiceProvider.GetService <IJT808UnificationTcpSendService>(); jT808SessionServiceDefaultImpl.GetAll(); string no = "123456789001"; // 文本信息包 JT808Package jT808Package2 = JT808.Protocol.Enums.JT808MsgId.文本信息下发.Create(no, new JT808_0x8300 { TextFlag = 5, TextInfo = "smallchi 518" }); var data = JT808Serializer.Serialize(jT808Package2); JT808ResultDto <bool> jt808Result = jT808UnificationTcpSendService.Send(no, data); Thread.Sleep(1000); Assert.AreEqual(200, jt808Result.Code); Assert.IsTrue(jt808Result.Data); }