Module com.aoapps.hodgepodge
Package com.aoapps.hodgepodge.net
Class BandwidthLimitingTunnelHandlerThread
java.lang.Object
com.aoapps.hodgepodge.net.BandwidthLimitingTunnelHandlerThread
- All Implemented Interfaces:
BitRateProvider,Runnable
- Direct Known Subclasses:
BandwidthLimitingTunnelHandlerDownstreamThread,BandwidthLimitingTunnelHandlerUpstreamThread
public abstract class BandwidthLimitingTunnelHandlerThread
extends Object
implements Runnable, BitRateProvider
Handles one direction of bandwidth for one connection for a
BandwidthLimitingTunnel.- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Fields inherited from interface com.aoapps.hodgepodge.io.BitRateProvider
MINIMUM_BIT_RATE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBandwidthLimitingTunnelHandlerThread(boolean verbose, Long bandwidth, Socket listenSocket, Socket connectSocket) -
Method Summary
Modifier and TypeMethodDescriptionGets the bit rate in bits per second,nullindicates unlimited bandwidth.intGets the block size in bytes.protected abstract Stringprotected abstract InputStreamgetInputStream(Socket listenSocket, Socket connectSocket) protected abstract OutputStreamgetOutputStream(Socket listenSocket, Socket connectSocket) voidrun()voidstart()
-
Constructor Details
-
BandwidthLimitingTunnelHandlerThread
-
-
Method Details
-
start
public void start() -
run
public void run() -
getBlockSize
public int getBlockSize()Description copied from interface:BitRateProviderGets the block size in bytes.- Specified by:
getBlockSizein interfaceBitRateProvider
-
getBitRate
Description copied from interface:BitRateProviderGets the bit rate in bits per second,nullindicates unlimited bandwidth.- Specified by:
getBitRatein interfaceBitRateProvider
-
getDirection
-
getOutputStream
protected abstract OutputStream getOutputStream(Socket listenSocket, Socket connectSocket) throws IOException - Throws:
IOException
-
getInputStream
protected abstract InputStream getInputStream(Socket listenSocket, Socket connectSocket) throws IOException - Throws:
IOException
-