changed samv3 because of reverted streaming and mstreaming libs
This commit is contained in:
@ -266,20 +266,17 @@ public class SAMv3StreamSession extends SAMStreamSession implements SAMv3Handle
|
|||||||
{
|
{
|
||||||
while (session.socketServer!=null) {
|
while (session.socketServer!=null) {
|
||||||
|
|
||||||
|
// wait and accept a connection from I2P side
|
||||||
I2PSocket i2ps = null ;
|
I2PSocket i2ps = null ;
|
||||||
try {
|
try {
|
||||||
session.socketServer.waitIncoming(0);
|
i2ps = session.socketServer.accept();
|
||||||
} catch (ConnectException e) {
|
} catch (Exception e) {}
|
||||||
_log.debug("ConnectException");
|
|
||||||
break ;
|
if (i2ps==null) {
|
||||||
} catch (I2PException e) {
|
continue ;
|
||||||
_log.debug("I2PServerSocket has been closed");
|
|
||||||
break ;
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
_log.debug("InterruptedException");
|
|
||||||
break ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// open a socket towards client
|
||||||
java.net.InetSocketAddress addr = new java.net.InetSocketAddress(host,port);
|
java.net.InetSocketAddress addr = new java.net.InetSocketAddress(host,port);
|
||||||
|
|
||||||
SocketChannel clientServerSock = null ;
|
SocketChannel clientServerSock = null ;
|
||||||
@ -289,17 +286,14 @@ public class SAMv3StreamSession extends SAMStreamSession implements SAMv3Handle
|
|||||||
catch ( IOException e ) {
|
catch ( IOException e ) {
|
||||||
continue ;
|
continue ;
|
||||||
}
|
}
|
||||||
|
if (clientServerSock==null) {
|
||||||
try {
|
|
||||||
i2ps = session.socketServer.accept(1);
|
|
||||||
} catch (Exception e) {}
|
|
||||||
|
|
||||||
if (i2ps==null) {
|
|
||||||
try {
|
try {
|
||||||
clientServerSock.close();
|
i2ps.close();
|
||||||
} catch (IOException ee) {}
|
} catch (IOException ee) {}
|
||||||
continue ;
|
continue ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// build pipes between both sockets
|
||||||
try {
|
try {
|
||||||
if (this.verbose)
|
if (this.verbose)
|
||||||
SAMv3Handler.notifyStreamIncomingConnection(
|
SAMv3Handler.notifyStreamIncomingConnection(
|
||||||
@ -308,10 +302,8 @@ public class SAMv3StreamSession extends SAMStreamSession implements SAMv3Handle
|
|||||||
ReadableByteChannel fromI2P = Channels.newChannel(i2ps.getInputStream());
|
ReadableByteChannel fromI2P = Channels.newChannel(i2ps.getInputStream());
|
||||||
WritableByteChannel toClient = clientServerSock ;
|
WritableByteChannel toClient = clientServerSock ;
|
||||||
WritableByteChannel toI2P = Channels.newChannel(i2ps.getOutputStream());
|
WritableByteChannel toI2P = Channels.newChannel(i2ps.getOutputStream());
|
||||||
I2PAppThread send = new I2PAppThread(new Pipe(fromClient,toI2P, "SAMPipeClientToI2P"), "SAMPipeClientToI2P");
|
(new I2PAppThread(new Pipe(fromClient,toI2P, "SAMPipeClientToI2P"), "SAMPipeClientToI2P")).start();
|
||||||
I2PAppThread recv = new I2PAppThread(new Pipe(fromI2P,toClient, "SAMPipeI2PToClient"), "SAMPipeI2PToClient");
|
(new I2PAppThread(new Pipe(fromI2P,toClient, "SAMPipeI2PToClient"), "SAMPipeI2PToClient")).start();
|
||||||
send.start();
|
|
||||||
recv.start();
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user