Package com.biglybt.core.networkmanager
Interface NetworkManager.ByteMatcher
- Enclosing class:
- NetworkManager
public static interface NetworkManager.ByteMatcher
Byte stream match filter for routing.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[][]
int
matches
(TransportHelper transport, ByteBuffer to_compare, int port) Check byte stream for match.int
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.minMatches
(TransportHelper transport, 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 Details
-
getDescription
String getDescription() -
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
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
Check for a minimum match- Parameters:
to_compare
-- Returns:
- return "routing data" in case of a match, null otherwise
-
getSpecificPort
int getSpecificPort()
-