Class VirtualNonBlockingServerChannelSelector
java.lang.Object
com.biglybt.core.networkmanager.impl.tcp.VirtualNonBlockingServerChannelSelector
- All Implemented Interfaces:
VirtualServerChannelSelector
public class VirtualNonBlockingServerChannelSelector
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 InetAddress
(package private) long
(package private) final VirtualServerChannelSelector.SelectListener
private static final LogIDs
private final int
private final int
private final List
private final int
protected final AEMonitor
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualNonBlockingServerChannelSelector
(InetAddress _bind_address, int _start_port, int _num_ports, int _so_rcvbuf_size, VirtualServerChannelSelector.SelectListener _listener) VirtualNonBlockingServerChannelSelector
(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 TypeMethodDescriptionint
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_channels
-
bind_address
-
start_port
private final int start_port -
num_ports
private final int num_ports -
receive_buffer_size
private final int receive_buffer_size -
listener
-
this_mon
-
alert_on_fail
private boolean alert_on_fail -
last_accept_time
long last_accept_time
-
-
Constructor Details
-
VirtualNonBlockingServerChannelSelector
public VirtualNonBlockingServerChannelSelector(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:
bind_address
- ip+port to listen onso_rcvbuf_size
- new socket receive buffer sizelistener
- to notify of incoming connections
-
VirtualNonBlockingServerChannelSelector
public VirtualNonBlockingServerChannelSelector(InetAddress _bind_address, int _start_port, int _num_ports, int _so_rcvbuf_size, VirtualServerChannelSelector.SelectListener _listener)
-
-
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
-
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
-