Package com.biglybt.core.proxy.impl
Class AEProxyImpl
java.lang.Object
com.biglybt.core.proxy.impl.AEProxyImpl
- All Implemented Interfaces:
VirtualChannelSelector.VirtualAbstractSelectorListener
,VirtualChannelSelector.VirtualSelectorListener
,AEProxy
public class AEProxyImpl
extends Object
implements AEProxy, VirtualChannelSelector.VirtualSelectorListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
(package private) final VirtualChannelSelector
private final long
private static final int
private boolean
private long
private static final LogIDs
private int
private final List
<AEProxyConnectionImpl> private final AEProxyHandler
(package private) final VirtualChannelSelector
private final long
private ServerSocketChannel
private final AEMonitor
private final HashMap
(package private) final VirtualChannelSelector
-
Constructor Summary
ConstructorsConstructorDescriptionAEProxyImpl
(int _port, long _connect_timeout, long _read_timeout, AEProxyHandler _proxy_handler) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected void
protected void
protected void
protected void
close
(AEProxyConnectionImpl processor) void
destroy()
int
getPort()
protected void
requestConnectSelect
(AEProxyConnectionImpl processor, SocketChannel sc) protected void
requestReadSelect
(AEProxyConnectionImpl processor, SocketChannel sc) protected void
requestWriteSelect
(AEProxyConnectionImpl processor, SocketChannel sc) void
selectFailure
(VirtualChannelSelector selector, SocketChannel sc, Object attachment, Throwable msg) Called when a channel selection fails.protected void
selectLoop
(VirtualChannelSelector selector) boolean
selectSuccess
(VirtualChannelSelector selector, SocketChannel sc, Object attachment) Called when a channel is successfully selected for readyness.void
setAllowExternalConnections
(boolean permit)
-
Field Details
-
LOGID
-
DEBUG_PERIOD
private static final int DEBUG_PERIOD- See Also:
-
last_debug
private long last_debug -
port
private int port -
connect_timeout
private final long connect_timeout -
read_timeout
private final long read_timeout -
proxy_handler
-
ssc
-
read_selector
-
connect_selector
-
write_selector
-
processors
-
write_select_regs
-
allow_external_access
private boolean allow_external_access -
this_mon
-
destroyed
private volatile boolean destroyed
-
-
Constructor Details
-
AEProxyImpl
public AEProxyImpl(int _port, long _connect_timeout, long _read_timeout, AEProxyHandler _proxy_handler) throws AEProxyException - Throws:
AEProxyException
-
-
Method Details
-
setAllowExternalConnections
public void setAllowExternalConnections(boolean permit) - Specified by:
setAllowExternalConnections
in interfaceAEProxy
-
acceptLoop
-
close
-
selectLoop
-
checkTimeouts
protected void checkTimeouts() -
requestWriteSelect
-
cancelWriteSelect
-
requestReadSelect
-
cancelReadSelect
-
requestConnectSelect
-
cancelConnectSelect
-
selectSuccess
Description copied from interface:VirtualChannelSelector.VirtualSelectorListener
Called when a channel is successfully selected for readyness.- Specified by:
selectSuccess
in interfaceVirtualChannelSelector.VirtualSelectorListener
- Parameters:
attachment
- originally given with the channel's registration- Returns:
- indicator of whether or not any 'progress' was made due to this select null -> progress made, String -> location of non progress e.g. read-select -> read >0 bytes, write-select -> wrote > 0 bytes
-
selectFailure
public void selectFailure(VirtualChannelSelector selector, SocketChannel sc, Object attachment, Throwable msg) Description copied from interface:VirtualChannelSelector.VirtualSelectorListener
Called when a channel selection fails.- Specified by:
selectFailure
in interfaceVirtualChannelSelector.VirtualSelectorListener
- Parameters:
msg
- failure message
-
getPort
public int getPort() -
destroy
public void destroy()
-