com.iteaj.iot.client.codec.FixedLengthFrameClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iot-client Show documentation
Show all versions of iot-client Show documentation
基于netty的tcp, http, udp等协议的客户端
The newest version!
package com.iteaj.iot.client.codec;
import com.iteaj.iot.client.ClientConnectProperties;
import com.iteaj.iot.client.TcpSocketClient;
import com.iteaj.iot.client.component.TcpClientComponent;
import com.iteaj.iot.codec.adapter.FixedLengthFrameDecoderAdapter;
import io.netty.channel.ChannelInboundHandler;
public class FixedLengthFrameClient extends TcpSocketClient {
private int frameLength;
public FixedLengthFrameClient(TcpClientComponent clientComponent, ClientConnectProperties config, int frameLength) {
super(clientComponent, config);
this.frameLength = frameLength;
}
@Override
protected ChannelInboundHandler createProtocolDecoder() {
return new FixedLengthFrameDecoderAdapter(frameLength);
}
public int getFrameLength() {
return frameLength;
}
public void setFrameLength(int frameLength) {
this.frameLength = frameLength;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy