Class VirtualBlockingServerChannelSelector
- java.lang.Object
-
- com.biglybt.core.networkmanager.impl.tcp.VirtualBlockingServerChannelSelector
-
- All Implemented Interfaces:
VirtualServerChannelSelector
public class VirtualBlockingServerChannelSelector 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.InetSocketAddress
bind_address
private long
last_accept_time
private VirtualServerChannelSelector.SelectListener
listener
private static LogIDs
LOGID
private int
receive_buffer_size
private java.nio.channels.ServerSocketChannel
server_channel
protected AEMonitor
this_mon
-
Constructor Summary
Constructors Constructor Description VirtualBlockingServerChannelSelector(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 protected void
accept_loop()
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_channel
private java.nio.channels.ServerSocketChannel server_channel
-
bind_address
private final java.net.InetSocketAddress bind_address
-
receive_buffer_size
private final int receive_buffer_size
-
listener
private final VirtualServerChannelSelector.SelectListener listener
-
this_mon
protected final AEMonitor this_mon
-
last_accept_time
private long last_accept_time
-
-
Constructor Detail
-
VirtualBlockingServerChannelSelector
public VirtualBlockingServerChannelSelector(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
-
-
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
-
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
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
-
-