org.tron.p2p.discover.socket.PacketDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libp2p Show documentation
Show all versions of libp2p Show documentation
libp2p is a p2p network SDK implemented in java language.
The newest version!
package org.tron.p2p.discover.socket;
import java.util.List;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.socket.DatagramPacket;
import io.netty.handler.codec.MessageToMessageDecoder;
import lombok.extern.slf4j.Slf4j;
import org.tron.p2p.discover.message.Message;
import org.tron.p2p.exception.P2pException;
@Slf4j(topic = "net")
public class PacketDecoder extends MessageToMessageDecoder {
private static final int MAXSIZE = 2048;
@Override
public void decode(ChannelHandlerContext ctx, DatagramPacket packet, List