com.iteaj.iot.client.codec.ClientProtocolEncoder 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.Message;
import com.iteaj.iot.ProtocolException;
import com.iteaj.iot.ProtocolPreservable;
import com.iteaj.iot.client.ClientComponent;
import com.iteaj.iot.client.ClientMessage;
import com.iteaj.iot.client.ClientProtocolException;
import com.iteaj.iot.client.protocol.ClientInitiativeProtocol;
import com.iteaj.iot.client.protocol.ClientSocketProtocol;
import com.iteaj.iot.client.protocol.ServerInitiativeProtocol;
import com.iteaj.iot.message.UnParseBodyMessage;
import com.iteaj.iot.utils.ByteUtil;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.List;
public class ClientProtocolEncoder extends MessageToMessageEncoder {
private ClientComponent clientComponent;
private static Logger logger = LoggerFactory.getLogger(ClientProtocolEncoder.class);
public ClientProtocolEncoder(ClientComponent clientComponent) {
this.clientComponent = clientComponent;
}
@Override
protected void encode(ChannelHandlerContext ctx, ClientSocketProtocol protocol, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy