Search in sources :

Example 1 with I2CPMessageQueue

use of net.i2p.internal.I2CPMessageQueue in project i2p.i2p by i2p.

the class ClientManager method internalConnect.

/**
 *  The InternalClientManager interface.
 *  Connects to the router, receiving a message queue to talk to the router with.
 *  @throws I2PSessionException if the router isn't ready
 *  @since 0.8.3
 */
public I2CPMessageQueue internalConnect() throws I2PSessionException {
    if (!_isStarted)
        throw new I2PSessionException("Router client manager is shut down");
    LinkedBlockingQueue<I2CPMessage> in = new LinkedBlockingQueue<I2CPMessage>(INTERNAL_QUEUE_SIZE);
    LinkedBlockingQueue<I2CPMessage> out = new LinkedBlockingQueue<I2CPMessage>(INTERNAL_QUEUE_SIZE);
    I2CPMessageQueue myQueue = new I2CPMessageQueueImpl(in, out);
    I2CPMessageQueue hisQueue = new I2CPMessageQueueImpl(out, in);
    ClientConnectionRunner runner = new QueuedClientConnectionRunner(_ctx, this, myQueue);
    registerConnection(runner);
    return hisQueue;
}
Also used : I2CPMessage(net.i2p.data.i2cp.I2CPMessage) I2PSessionException(net.i2p.client.I2PSessionException) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) I2CPMessageQueue(net.i2p.internal.I2CPMessageQueue)

Aggregations

LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 I2PSessionException (net.i2p.client.I2PSessionException)1 I2CPMessage (net.i2p.data.i2cp.I2CPMessage)1 I2CPMessageQueue (net.i2p.internal.I2CPMessageQueue)1