forked from I2P_Developers/i2p.i2p
Added rudimentary channel support.
This commit is contained in:
@@ -3,6 +3,7 @@ package net.i2p.client.streaming;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.nio.channels.SelectableChannel;
|
||||||
|
|
||||||
import net.i2p.data.Destination;
|
import net.i2p.data.Destination;
|
||||||
|
|
||||||
@@ -34,6 +35,8 @@ public interface I2PSocket {
|
|||||||
*/
|
*/
|
||||||
public OutputStream getOutputStream() throws IOException;
|
public OutputStream getOutputStream() throws IOException;
|
||||||
|
|
||||||
|
public SelectableChannel getChannel() throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return socket's configuration
|
* @return socket's configuration
|
||||||
*/
|
*/
|
||||||
|
@@ -3,6 +3,7 @@ package net.i2p.client.streaming;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.nio.channels.SelectableChannel;
|
||||||
|
|
||||||
import net.i2p.client.I2PSession;
|
import net.i2p.client.I2PSession;
|
||||||
import net.i2p.data.Destination;
|
import net.i2p.data.Destination;
|
||||||
@@ -66,6 +67,10 @@ class I2PSocketFull implements I2PSocket {
|
|||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SelectableChannel getChannel() {
|
||||||
|
return new MessageChannel(this);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Warning, may return null instead of throwing IOE,
|
* Warning, may return null instead of throwing IOE,
|
||||||
|
@@ -71,7 +71,7 @@ class StandardSocket extends Socket {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SocketChannel getChannel() {
|
public SocketChannel getChannel() {
|
||||||
return null;
|
return _socket.getChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user