This commit is contained in:
zzz
2011-11-07 14:21:07 +00:00
parent 67cc3ad5b0
commit 8ecf423dfc
5 changed files with 13 additions and 1 deletions

View File

@@ -6,6 +6,9 @@ import net.i2p.I2PException;
import java.net.ConnectException; import java.net.ConnectException;
import java.nio.channels.SelectableChannel; import java.nio.channels.SelectableChannel;
/**
* @since 0.8.11
*/
public abstract class AcceptingChannel extends SelectableChannel { public abstract class AcceptingChannel extends SelectableChannel {
abstract I2PSocket accept() throws I2PException, ConnectException; abstract I2PSocket accept() throws I2PException, ConnectException;
I2PSocketManager _socketManager; I2PSocketManager _socketManager;

View File

@@ -31,6 +31,9 @@ public interface I2PServerSocket {
*/ */
public I2PSocket accept() throws I2PException, ConnectException, SocketTimeoutException; public I2PSocket accept() throws I2PException, ConnectException, SocketTimeoutException;
/**
* @since 0.8.11
*/
public AcceptingChannel getChannel(); public AcceptingChannel getChannel();
/** /**

View File

@@ -12,6 +12,9 @@ import java.nio.channels.Selector;
import java.nio.channels.spi.AbstractSelectionKey; import java.nio.channels.spi.AbstractSelectionKey;
import java.nio.channels.spi.SelectorProvider; import java.nio.channels.spi.SelectorProvider;
/**
* @since 0.8.11
*/
public class AcceptingChannelImpl extends AcceptingChannel { public class AcceptingChannelImpl extends AcceptingChannel {
boolean _isRegistered = false; boolean _isRegistered = false;
SelectionKey whichKey = null; SelectionKey whichKey = null;

View File

@@ -25,6 +25,9 @@ class I2PServerSocketFull implements I2PServerSocket {
return _socketManager.receiveSocket(); return _socketManager.receiveSocket();
} }
/**
* @since 0.8.11
*/
public AcceptingChannel getChannel() { public AcceptingChannel getChannel() {
return new AcceptingChannelImpl(_socketManager); return new AcceptingChannelImpl(_socketManager);
} }

View File

@@ -221,7 +221,7 @@ public class BloomSHA1 {
/** /**
* Get the bloom filter offsets for reuse. * Get the bloom filter offsets for reuse.
* Caller should call rv.release() when done. * Caller should call release(rv) when done with it.
* @since 0.8.11 * @since 0.8.11
*/ */
public FilterKey getFilterKey(byte[] b, int offset, int len) { public FilterKey getFilterKey(byte[] b, int offset, int len) {