Class VirtualBlockingServerChannelSelector
java.lang.Object
com.biglybt.core.networkmanager.impl.tcp.VirtualBlockingServerChannelSelector
- All Implemented Interfaces:
VirtualServerChannelSelector
public class VirtualBlockingServerChannelSelector
extends Object
implements VirtualServerChannelSelector
Virtual server socket channel for listening and accepting incoming connections.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.biglybt.core.networkmanager.VirtualServerChannelSelector
VirtualServerChannelSelector.SelectListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final InetSocketAddress
private long
private final VirtualServerChannelSelector.SelectListener
private static final LogIDs
private final int
private ServerSocketChannel
protected final AEMonitor
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualBlockingServerChannelSelector
(InetSocketAddress _bind_address, int so_rcvbuf_size, VirtualServerChannelSelector.SelectListener listener) Create a new server listening on the given address and reporting to the given listener. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
getPort()
long
boolean
Is this selector actively runningvoid
setAlertOnFail
(boolean b) void
Start the server and begin accepting incoming connections.void
Stop the server.
-
Field Details
-
LOGID
-
server_channel
-
bind_address
-
receive_buffer_size
private final int receive_buffer_size -
listener
-
this_mon
-
last_accept_time
private long last_accept_time -
alert_on_fail
private boolean alert_on_fail
-
-
Constructor Details
-
VirtualBlockingServerChannelSelector
public VirtualBlockingServerChannelSelector(InetSocketAddress _bind_address, int so_rcvbuf_size, VirtualServerChannelSelector.SelectListener listener) Create a new server listening on the given address and reporting to the given listener.- Parameters:
so_rcvbuf_size
- new socket receive buffer sizelistener
- to notify of incoming connectionsbind_address
- ip+port to listen on
-
-
Method Details
-
setAlertOnFail
public void setAlertOnFail(boolean b) - Specified by:
setAlertOnFail
in interfaceVirtualServerChannelSelector
-
startProcessing
public void startProcessing()Start the server and begin accepting incoming connections.- Specified by:
startProcessing
in interfaceVirtualServerChannelSelector
-
stopProcessing
public void stopProcessing()Stop the server.- Specified by:
stopProcessing
in interfaceVirtualServerChannelSelector
-
accept_loop
protected void accept_loop() -
isRunning
public boolean isRunning()Is this selector actively running- Specified by:
isRunning
in interfaceVirtualServerChannelSelector
- Returns:
- true if enabled, false if not running
-
getBoundToAddress
- Specified by:
getBoundToAddress
in interfaceVirtualServerChannelSelector
-
getPort
public int getPort()- Specified by:
getPort
in interfaceVirtualServerChannelSelector
-
getTimeOfLastAccept
public long getTimeOfLastAccept()- Specified by:
getTimeOfLastAccept
in interfaceVirtualServerChannelSelector
-