merge of '4f86a13e5f3de7eb4aae8a1f0f3402e46f262ca2'

and 'ecd077c360b4af5597166def49e62d6a82e57937'
This commit is contained in:
dream
2011-10-01 17:28:57 +00:00
3 changed files with 9 additions and 1 deletions

View File

@@ -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
*/

View File

@@ -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,

View File

@@ -71,7 +71,7 @@ class StandardSocket extends Socket {
*/
@Override
public SocketChannel getChannel() {
return null;
return _socket.getChannel();
}
/**