Fetch the repository succeeded.
This action will force synchronization from baolinking/物联网关, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
/**
*
*/
package divpro;
import java.util.Date;
import connect.ConfigDesign;
import connect.FlowListener;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.protobuf.ProtobufEncoder;
import protobuf.MasterMessage;
import protobuf.MasterMessage.Message;
/**
* @Description:
* @version: v1.0.0
* @author: wbl
* @date: 2019年9月10日 上午8:57:58
*/
public class Check376Handler extends ChannelInboundHandlerAdapter{
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
String body = msg.toString();
String ipport = body.split("_")[0];
String data = body.split("_")[1];
FlowListener.getInstance().writeFlow(ipport, data.length()/2);
if("68".equals(data.substring(0,2)) && "68".equals(data.substring(10,12))
&& "16".equals(data.substring(data.length()-2))){
Channel channel = MasterSlotsPartition.getInstance().getActiveMaster();
Message mast = MasterMessage.Message.newBuilder().setIp(ipport.split(":")[0])
.setPort(ipport.split(":")[1]).setProtocolId(DivMultiprotocolSelection.PROTOCOL_TYPES)
.setContent(data).build();
// channel.write(mast);//这都是单线程往服务端发,很影响性能,考虑中间件
channel.writeAndFlush(mast);
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。