|
@@ -8,6 +8,7 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
|
|
|
import io.netty.channel.SimpleChannelInboundHandler;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
import org.slf4j.Logger;
|
|
|
+import sun.awt.image.GifImageDecoder;
|
|
|
import wei.yigulu.iec104.apdumodel.Apdu;
|
|
|
import wei.yigulu.iec104.container.Iec104Link;
|
|
|
import wei.yigulu.iec104.container.LinkContainer;
|
|
@@ -58,8 +59,12 @@ public class Slave104Handle extends SimpleChannelInboundHandler<ByteBuf> {
|
|
|
//收数据
|
|
|
log.debug("----------------------------------------------------------------------------------");
|
|
|
log.debug("re <= "+DataConvertor.ByteBuf2String( msg));
|
|
|
- Apdu apdu = apduClass.newInstance().setChannel(ctx.channel()).setIec104Builder(slaverBuilder).setLog(slaverBuilder.getLog()).loadByteBuf(msg);
|
|
|
- apdu.answer();
|
|
|
+ if (slaverBuilder.getChannels().contains(ctx.channel())){
|
|
|
+ Apdu apdu = apduClass.newInstance().setChannel(ctx.channel()).setIec104Builder(slaverBuilder).setLog(slaverBuilder.getLog()).loadByteBuf(msg);
|
|
|
+ apdu.answer();
|
|
|
+ }else{
|
|
|
+ ctx.channel().close();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|