Code Monkey home page Code Monkey logo

jt808platform's People

Contributors

smallchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jt808platform's Issues

hello sir

老哥,还能私下请教你点问题呀,我qq786744873 答案666666

关于ChildHandler下创建NettyTcpServerHandler等handler的lifetime的问题

有个地方不是很明白,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>()); } }));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.