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 VirtualServerChannelSelector
VirtualServerChannelSelector.SelectListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final InetAddress(package private) long(package private) final VirtualServerChannelSelector.SelectListenerprivate static final LogIDsprivate final intprivate final intprivate final Listprivate final intprotected 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 TypeMethodDescriptionintgetPort()longbooleanIs this selector actively runningvoidsetAlertOnFail(boolean b) voidStart the server and begin accepting incoming connections.voidStop 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:
setAlertOnFailin interfaceVirtualServerChannelSelector
-
startProcessing
public void startProcessing()Start the server and begin accepting incoming connections.- Specified by:
startProcessingin interfaceVirtualServerChannelSelector
-
stopProcessing
public void stopProcessing()Stop the server.- Specified by:
stopProcessingin interfaceVirtualServerChannelSelector
-
isRunning
public boolean isRunning()Is this selector actively running- Specified by:
isRunningin interfaceVirtualServerChannelSelector- Returns:
- true if enabled, false if not running
-
getBoundToAddress
- Specified by:
getBoundToAddressin interfaceVirtualServerChannelSelector
-
getPort
public int getPort()- Specified by:
getPortin interfaceVirtualServerChannelSelector
-
getTimeOfLastAccept
public long getTimeOfLastAccept()- Specified by:
getTimeOfLastAcceptin interfaceVirtualServerChannelSelector
-