com.iteaj.iot.client.component.FixedLengthFrameClientComponent 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.component;
import com.iteaj.iot.client.ClientConnectProperties;
import com.iteaj.iot.client.ClientMessage;
import com.iteaj.iot.client.MultiClientManager;
import com.iteaj.iot.client.TcpSocketClient;
import com.iteaj.iot.client.codec.FixedLengthFrameClient;
/**
* 使用固定长度解码器的客户端组件
* @see FixedLengthFrameClient
* @see io.netty.handler.codec.FixedLengthFrameDecoder
* @param
*/
public abstract class FixedLengthFrameClientComponent extends TcpClientComponent {
private int frameLength;
public FixedLengthFrameClientComponent(ClientConnectProperties config, int frameLength) {
super(config);
this.frameLength = frameLength;
}
public FixedLengthFrameClientComponent(ClientConnectProperties config, MultiClientManager clientManager, int frameLength) {
super(config, clientManager);
this.frameLength = frameLength;
}
@Override
public TcpSocketClient createNewClient(ClientConnectProperties config) {
return new FixedLengthFrameClient(this, config, this.frameLength);
}
public int getFrameLength() {
return frameLength;
}
public void setFrameLength(int frameLength) {
this.frameLength = frameLength;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy