Package com.aoindustries.net
Class BandwidthLimitingTunnelHandlerThread
- java.lang.Object
-
- com.aoindustries.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 aBandwidthLimitingTunnel.- Author:
- AO Industries, Inc.
- See Also:
BandwidthLimitingTunnelHandler,BandwidthLimitingTunnel
-
-
Field Summary
-
Fields inherited from interface com.aoindustries.io.BitRateProvider
MINIMUM_BIT_RATE
-
-
Constructor Summary
Constructors Constructor Description BandwidthLimitingTunnelHandlerThread(boolean verbose, Long bandwidth, Socket listenSocket, Socket connectSocket)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description LonggetBitRate()Gets the bit rate in bits per second,nullindicates unlimited bandwidth.intgetBlockSize()Gets the block size in bytes.protected abstract StringgetDirection()protected abstract InputStreamgetInputStream(Socket listenSocket, Socket connectSocket)protected abstract OutputStreamgetOutputStream(Socket listenSocket, Socket connectSocket)voidrun()voidstart()
-
-
-
Method Detail
-
start
public void start()
-
getBlockSize
public int getBlockSize()
Description copied from interface:BitRateProviderGets the block size in bytes.- Specified by:
getBlockSizein interfaceBitRateProvider
-
getBitRate
public Long getBitRate()
Description copied from interface:BitRateProviderGets the bit rate in bits per second,nullindicates unlimited bandwidth.- Specified by:
getBitRatein interfaceBitRateProvider
-
getDirection
protected abstract String 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
-
-