Search in sources :

Example 6 with I2PServerSocket

use of net.i2p.client.streaming.I2PServerSocket in project i2p.i2p by i2p.

the class SAMv3StreamSession method stopForwardingIncoming.

/**
 *  stop Forwarding Incoming connection coming from I2P
 * @throws SAMException
 * @throws InterruptedIOException
 */
public void stopForwardingIncoming() throws SAMException, InterruptedIOException {
    SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick);
    if (rec == null)
        throw new InterruptedIOException();
    I2PServerSocket server = null;
    synchronized (this.socketServerLock) {
        if (this.socketServer == null) {
            if (_log.shouldLog(Log.DEBUG))
                _log.debug("no socket server is defined for this destination");
            throw new SAMException("no socket server is defined for this destination");
        }
        server = this.socketServer;
        this.socketServer = null;
        if (_log.shouldLog(Log.DEBUG))
            _log.debug("nulling socketServer in stopForwardingIncoming. Object " + this);
    }
    try {
        server.close();
    } catch (I2PException e) {
    }
}
Also used : I2PException(net.i2p.I2PException) InterruptedIOException(java.io.InterruptedIOException) I2PServerSocket(net.i2p.client.streaming.I2PServerSocket)

Aggregations

I2PServerSocket (net.i2p.client.streaming.I2PServerSocket)6 I2PException (net.i2p.I2PException)5 IOException (java.io.IOException)4 ConnectException (java.net.ConnectException)2 I2PSocket (net.i2p.client.streaming.I2PSocket)2 I2PAppThread (net.i2p.util.I2PAppThread)2 InterruptedIOException (java.io.InterruptedIOException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 RouterRestartException (net.i2p.client.streaming.RouterRestartException)1 Destination (net.i2p.data.Destination)1 Hash (net.i2p.data.Hash)1