com.threerings.presents.server.net
Class DatagramChannelReader

java.lang.Object
  extended by com.threerings.presents.server.net.DatagramChannelReader
All Implemented Interfaces:
Lifecycle.BaseComponent, Lifecycle.ShutdownComponent

public class DatagramChannelReader
extends Object
implements Lifecycle.ShutdownComponent

Binds datagram connections on a given hostname for a set of ports, and passes datagrams read off those ports into a connection manager.


Field Summary
protected  PresentsConnectionManager _conMan
           
protected  List<DatagramChannel> _datagramChannels
           
protected  String _datagramHostname
           
protected  int[] _datagramPorts
           
 
Constructor Summary
DatagramChannelReader(String datagramHostname, int[] datagramPorts, PresentsConnectionManager conMgr)
           
 
Method Summary
protected  void acceptDatagrams(int port)
           
 void bind()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_datagramPorts

protected final int[] _datagramPorts

_datagramHostname

protected final String _datagramHostname

_datagramChannels

protected final List<DatagramChannel> _datagramChannels

_conMan

protected final PresentsConnectionManager _conMan
Constructor Detail

DatagramChannelReader

public DatagramChannelReader(String datagramHostname,
                             int[] datagramPorts,
                             PresentsConnectionManager conMgr)
Method Detail

bind

public void bind()

shutdown

public void shutdown()
Specified by:
shutdown in interface Lifecycle.ShutdownComponent

acceptDatagrams

protected void acceptDatagrams(int port)
                        throws IOException
Throws:
IOException