com.aelitis.azureus.core.networkmanager.impl.tcp
Class VirtualBlockingServerChannelSelector

java.lang.Object
  extended by com.aelitis.azureus.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.aelitis.azureus.core.networkmanager.VirtualServerChannelSelector
VirtualServerChannelSelector.SelectListener
 
Field Summary
protected  AEMonitor this_mon
           
 
Constructor Summary
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
protected  void accept_loop()
           
 java.net.InetAddress getBoundToAddress()
           
 int getPort()
           
 long getTimeOfLastAccept()
           
 boolean isRunning()
          Is this selector actively running
 void start()
          Start the server and begin accepting incoming connections.
 void stop()
          Stop the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

this_mon

protected final AEMonitor this_mon
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 on
so_rcvbuf_size - new socket receive buffer size
listener - to notify of incoming connections
Method Detail

start

public void start()
Start the server and begin accepting incoming connections.

Specified by:
start in interface VirtualServerChannelSelector

stop

public void stop()
Stop the server.

Specified by:
stop in interface VirtualServerChannelSelector

accept_loop

protected void accept_loop()

isRunning

public boolean isRunning()
Is this selector actively running

Specified by:
isRunning in interface VirtualServerChannelSelector
Returns:
true if enabled, false if not running

getBoundToAddress

public java.net.InetAddress getBoundToAddress()
Specified by:
getBoundToAddress in interface VirtualServerChannelSelector

getPort

public int getPort()
Specified by:
getPort in interface VirtualServerChannelSelector

getTimeOfLastAccept

public long getTimeOfLastAccept()
Specified by:
getTimeOfLastAccept in interface VirtualServerChannelSelector