Class VirtualNonBlockingServerChannelSelector
- java.lang.Object
-
- com.biglybt.core.networkmanager.impl.tcp.VirtualNonBlockingServerChannelSelector
-
- All Implemented Interfaces:
VirtualServerChannelSelector
public class VirtualNonBlockingServerChannelSelector extends java.lang.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
Fields Modifier and Type Field Description private java.net.InetAddress
bind_address
(package private) long
last_accept_time
(package private) VirtualServerChannelSelector.SelectListener
listener
private static LogIDs
LOGID
private int
num_ports
private int
receive_buffer_size
private java.util.List
server_channels
private int
start_port
protected AEMonitor
this_mon
-
Constructor Summary
Constructors Constructor Description VirtualNonBlockingServerChannelSelector(java.net.InetAddress _bind_address, int _start_port, int _num_ports, int _so_rcvbuf_size, VirtualServerChannelSelector.SelectListener _listener)
VirtualNonBlockingServerChannelSelector(java.net.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.InetAddress
getBoundToAddress()
int
getPort()
long
getTimeOfLastAccept()
boolean
isRunning()
Is this selector actively runningvoid
startProcessing()
Start the server and begin accepting incoming connections.void
stopProcessing()
Stop the server.
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
server_channels
private final java.util.List server_channels
-
bind_address
private final java.net.InetAddress 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
final VirtualServerChannelSelector.SelectListener listener
-
this_mon
protected final AEMonitor this_mon
-
last_accept_time
long last_accept_time
-
-
Constructor Detail
-
VirtualNonBlockingServerChannelSelector
public VirtualNonBlockingServerChannelSelector(java.net.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(java.net.InetAddress _bind_address, int _start_port, int _num_ports, int _so_rcvbuf_size, VirtualServerChannelSelector.SelectListener _listener)
-
-
Method Detail
-
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
public java.net.InetAddress getBoundToAddress()
- Specified by:
getBoundToAddress
in interfaceVirtualServerChannelSelector
-
getPort
public int getPort()
- Specified by:
getPort
in interfaceVirtualServerChannelSelector
-
getTimeOfLastAccept
public long getTimeOfLastAccept()
- Specified by:
getTimeOfLastAccept
in interfaceVirtualServerChannelSelector
-
-