com.opera.core.systems.util
Class SocketMonitor

java.lang.Object
  extended by com.opera.core.systems.util.SocketMonitor

public class SocketMonitor
extends Object

This will monitor any selectable channel, such as a SocketChannel or ServerSocketChannel and fire SocketListener.canWrite(java.nio.channels.SelectableChannel) or SocketListener.canRead(java.nio.channels.SelectableChannel) events when such events are detected by poll().

Author:
Jan Vidar Krey

Constructor Summary
SocketMonitor()
           
 
Method Summary
 boolean add(SelectableChannel channel, SocketListener listener, int selectMask)
           
 boolean modify(SelectableChannel channel, SocketListener listener, int selectMask)
           
 boolean poll()
           
 boolean poll(long ms)
           
protected  void processSelectionKey(SelectionKey key)
           
 void remove(SelectableChannel channel)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketMonitor

public SocketMonitor()
Method Detail

add

public boolean add(SelectableChannel channel,
                   SocketListener listener,
                   int selectMask)

modify

public boolean modify(SelectableChannel channel,
                      SocketListener listener,
                      int selectMask)

remove

public void remove(SelectableChannel channel)

stop

public void stop()

poll

public boolean poll()

poll

public boolean poll(long ms)

processSelectionKey

protected void processSelectionKey(SelectionKey key)
                            throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.