Package com.biglybt.core.networkmanager
Interface NetworkManager.ByteMatcher
-
- Enclosing class:
- NetworkManager
public static interface NetworkManager.ByteMatcher
Byte stream match filter for routing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[][]
getSharedSecrets()
int
getSpecificPort()
java.lang.Object
matches(TransportHelper transport, java.nio.ByteBuffer to_compare, int port)
Check byte stream for match.int
matchThisSizeOrBigger()
Number of bytes of buffer at or beyond which the "match" method will be called to test for a matchint
maxSize()
Get the max number of bytes this matcher requires.java.lang.Object
minMatches(TransportHelper transport, java.nio.ByteBuffer to_compare, int port)
Check for a minimum matchint
minSize()
Get the minimum number of bytes required to determine if this matcher applies
-
-
-
Method Detail
-
matchThisSizeOrBigger
int matchThisSizeOrBigger()
Number of bytes of buffer at or beyond which the "match" method will be called to test for a match- Returns:
-
maxSize
int maxSize()
Get the max number of bytes this matcher requires. If it fails with this (or more) bytes then the connection will be dropped- Returns:
- size in bytes
-
minSize
int minSize()
Get the minimum number of bytes required to determine if this matcher applies- Returns:
-
matches
java.lang.Object matches(TransportHelper transport, java.nio.ByteBuffer to_compare, int port)
Check byte stream for match.- Parameters:
address
- the originator of the connectionto_compare
-- Returns:
- return "routing data" in case of a match, null otherwise
-
minMatches
java.lang.Object minMatches(TransportHelper transport, java.nio.ByteBuffer to_compare, int port)
Check for a minimum match- Parameters:
to_compare
-- Returns:
- return "routing data" in case of a match, null otherwise
-
getSharedSecrets
byte[][] getSharedSecrets()
-
getSpecificPort
int getSpecificPort()
-
-