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 VirtualServerChannelSelector
VirtualServerChannelSelector.SelectListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final InetSocketAddressprivate longprivate final VirtualServerChannelSelector.SelectListenerprivate static final LogIDsprivate final intprivate ServerSocketChannelprotected 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 voidintgetPort()longbooleanIs this selector actively runningvoidsetAlertOnFail(boolean b) voidStart the server and begin accepting incoming connections.voidStop 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:
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
-
accept_loop
protected void accept_loop() -
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
-