diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java index 595385cc4773980f6f87384691b35874db1d0925..4c135ee662876e0e26043a1c86965b0c42daa4f3 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java @@ -3,6 +3,7 @@ package net.i2p.client.streaming; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.channels.SelectableChannel; import net.i2p.data.Destination; @@ -34,6 +35,8 @@ public interface I2PSocket { */ public OutputStream getOutputStream() throws IOException; + public SelectableChannel getChannel() throws IOException; + /** * @return socket's configuration */ diff --git a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java index 5cd76a864f376d414e40705f4ba4c0bcfe8e4795..59e31b662bcf838a7b1778547e268e0b7bc649b1 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java @@ -3,6 +3,7 @@ package net.i2p.client.streaming; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.channels.SelectableChannel; import net.i2p.client.I2PSession; import net.i2p.data.Destination; @@ -66,6 +67,10 @@ class I2PSocketFull implements I2PSocket { else return null; } + + public SelectableChannel getChannel() { + return new MessageChannel(this); + } /** * Warning, may return null instead of throwing IOE, diff --git a/apps/streaming/java/src/net/i2p/client/streaming/StandardSocket.java b/apps/streaming/java/src/net/i2p/client/streaming/StandardSocket.java index b0ffbf250443545e5b679cde7d35b219ae78a706..22b04881c1e328d1bc00c5dd837bfd00eb8b63be 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/StandardSocket.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/StandardSocket.java @@ -71,7 +71,7 @@ class StandardSocket extends Socket { */ @Override public SocketChannel getChannel() { - return null; + return _socket.getChannel(); } /**