smallchi / jt808platform Goto Github PK
View Code? Open in Web Editor NEW简单的JT808车辆监控平台
License: MIT License
简单的JT808车辆监控平台
License: MIT License
老哥,还能私下请教你点问题呀,我qq786744873 答案666666
有个地方不是很明白,netty的ChildHandler是否意味着一个新的连接上来创建一个handler,该连接直到断开前都是这个handler,还是每次send消息后一个新的handler,如果是前者的话,是不是意味着该NettyTcpServerHandler实例handler实例的相关的构造函数注入的参数伴随着channel连接到断开的整个周期,如果相关的NettyTcpServerHandler中包含有相关的数据库连接等对象时,是不是意味着1W个连接,创建1W个数据库连接实例,在连接断开前一直不会被释放呢呢?
bootstrap .Option(ChannelOption.SoBacklog, configuration.SoBacklog) .ChildOption(ChannelOption.Allocator, serverBufferAllocator) .ChildHandler(new ActionChannelInitializer<IChannel>(channel => { IChannelPipeline pipeline = channel.Pipeline; using (var scope = serviceProvider.CreateScope()) { channel.Pipeline.AddLast("jt808TcpBuffer", new DelimiterBasedFrameDecoder(int.MaxValue, Unpooled.CopiedBuffer(new byte[] { JT808.Protocol.JT808Package.BeginFlag }), Unpooled.CopiedBuffer(new byte[] { JT808.Protocol.JT808Package.EndFlag }))); channel.Pipeline.AddLast("jt808TcpDecode", scope.ServiceProvider.GetRequiredService<UnionTcpDecoder>()); channel.Pipeline.AddLast("jt808TcpEncode", scope.ServiceProvider.GetRequiredService<UnionTcpEncoder>()); channel.Pipeline.AddLast("systemIdleState", new IdleStateHandler( configuration.ReaderIdleTimeSeconds, configuration.WriterIdleTimeSeconds, configuration.AllIdleTimeSeconds)); channel.Pipeline.AddLast("jt808TcpConnection", scope.ServiceProvider.GetRequiredService<NettyTcpConnectionHandler>()); channel.Pipeline.AddLast("jt808TcpService", scope.ServiceProvider.GetRequiredService<NettyTcpServerHandler>()); } }));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.