org.tron.p2p.connection.business.handshake.DisconnectCode 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.connection.business.handshake;
public enum DisconnectCode {
NORMAL(0),
TOO_MANY_PEERS(1),
DIFFERENT_VERSION(2),
TIME_BANNED(3),
DUPLICATE_PEER(4),
MAX_CONNECTION_WITH_SAME_IP(5),
UNKNOWN(256);
private final Integer value;
DisconnectCode(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
public static DisconnectCode forNumber(int code) {
for (DisconnectCode disconnectCode : values()) {
if (disconnectCode.value == code) {
return disconnectCode;
}
}
return UNKNOWN;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy