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
ModifierConstructorDescriptionprotected
BandwidthLimitingTunnelHandlerThread
(boolean verbose, Long bandwidth, Socket listenSocket, Socket connectSocket) -
Method Summary
Modifier and TypeMethodDescriptionGets the bit rate in bits per second,null
indicates unlimited bandwidth.int
Gets the block size in bytes.protected abstract String
protected abstract InputStream
getInputStream
(Socket listenSocket, Socket connectSocket) protected abstract OutputStream
getOutputStream
(Socket listenSocket, Socket connectSocket) void
run()
void
start()
-
Constructor Details
-
BandwidthLimitingTunnelHandlerThread
-
-
Method Details
-
start
public void start() -
run
public void run() -
getBlockSize
public int getBlockSize()Description copied from interface:BitRateProvider
Gets the block size in bytes.- Specified by:
getBlockSize
in interfaceBitRateProvider
-
getBitRate
Description copied from interface:BitRateProvider
Gets the bit rate in bits per second,null
indicates unlimited bandwidth.- Specified by:
getBitRate
in 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
-