Netty断线重连 最近使用Netty开发一个中转服务,需要一直保持与Server端的连接,网络中断后需要可以自动重连,查询官网资料,实现方案很简单,核心思想是在channelUnregistered钩子函数里执行重连. 创建连接 需要把configureBootstrap重构为一个函数,方便后续复用 EventLoopGroup group = new NioEventLoopGroup(); private volatile Bootstrap bootstrap; public voi
using Mina.Filter.Codec; using Mina.Filter.Codec.TextLine; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using Mina.Core.Session; using System.Threading; namespace MinaDemo { class TCPMessageD