Class BTPeerIDByteDecoder
java.lang.Object
com.biglybt.core.peermanager.utils.BTPeerIDByteDecoder
Used for identifying clients by their peerID.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static boolean
(package private) static final boolean
private static final HashSet
private static final HashSet
private static AEDiagnosticsLogger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
assertDecode
(String client_result, byte[] peer_id) private static void
assertDecode
(String client_result, String peer_id) private static String
asUTF8ByteString
(String text) static String
Decodes the given peerID, returning an identification string.static String
private static String
decodeBitCometClient
(String peer_id, byte[] peer_id_bytes) private static String
decodeBitSpiritClient
(String peer_id, byte[] peer_id_bytes) protected static String
getPrintablePeerID
(byte[] peer_id) protected static String
getPrintablePeerID
(byte[] peer_id, char fallback_char) static String
identifyAwkwardClient
(byte[] peer_id) static void
logClientDiscrepancy
(String peer_id_name, String handshake_name, String discrepancy, String protocol, byte[] peer_id) private static void
logClientDiscrepancyToFile
(String line_to_log) (package private) static void
logUnknownClient
(byte[] peer_id_bytes, boolean to_debug_out) (package private) static void
logUnknownClient
(String peer_id, String net) private static String
logUnknownClient0
(byte[] peer_id_bytes) static void
private static String
makePeerIDReadableAndUsable
(byte[] peer_id) (package private) static byte[]
peerIDStringToBytes
(String peer_id)
-
Field Details
-
LOG_UNKNOWN
static final boolean LOG_UNKNOWN -
logged_discrepancies
-
logger
-
client_logging_allowed
static boolean client_logging_allowed -
logged_ids
-
-
Constructor Details
-
BTPeerIDByteDecoder
public BTPeerIDByteDecoder()
-
-
Method Details
-
logUnknownClient0
- Throws:
IOException
-
asUTF8ByteString
-
logClientDiscrepancy
-
logClientDiscrepancyToFile
-
logUnknownClient
static void logUnknownClient(byte[] peer_id_bytes, boolean to_debug_out) -
logUnknownClient
-
decode0
-
decode
Decodes the given peerID, returning an identification string. -
identifyAwkwardClient
-
decodeBitSpiritClient
-
decodeBitCometClient
-
getPrintablePeerID
-
getPrintablePeerID
-
makePeerIDReadableAndUsable
-
peerIDStringToBytes
- Throws:
Exception
-
assertDecode
- Throws:
Exception
-
assertDecode
- Throws:
Exception
-
main
- Throws:
Exception
-