org.tron.p2p.discover.socket.P2pPacketDecoder 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 com.google.protobuf.InvalidProtocolBufferException;
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;
import org.tron.p2p.utils.ByteArray;
@Slf4j(topic = "net")
public class P2pPacketDecoder extends MessageToMessageDecoder {
private static final int MAXSIZE = 2048;
@Override
public void decode(ChannelHandlerContext ctx, DatagramPacket packet, List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy