Added an "accepting" channel for I2PServerSockets that is really low brow, but should work for now. Compiles, runs.

This commit is contained in:
dream
2011-11-04 22:56:09 +00:00
parent 668df37d20
commit 26d3646630
4 changed files with 162 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package net.i2p.client.streaming;
import net.i2p.client.streaming.I2PSocket;
import net.i2p.client.streaming.I2PSocketManager;
import net.i2p.I2PException;
import java.net.ConnectException;
import java.nio.channels.SelectableChannel;
public abstract class AcceptingChannel extends SelectableChannel {
abstract I2PSocket accept() throws I2PException, ConnectException;
I2PSocketManager _socketManager;
AcceptingChannel(I2PSocketManager manager) {
this._socketManager = manager;
}
}

View File

@@ -31,6 +31,8 @@ public interface I2PServerSocket {
*/
public I2PSocket accept() throws I2PException, ConnectException, SocketTimeoutException;
public AcceptingChannel getChannel();
/**
* Set Sock Option accept timeout
* @param x timeout in ms