net.i2p.router.transport.tcp
Class ConnectionBuilder

java.lang.Object
  extended by net.i2p.router.transport.tcp.ConnectionBuilder

public class ConnectionBuilder
extends java.lang.Object

Class responsible for all of the handshaking necessary to establish a connection with a peer.


Field Summary
static int CONNECTION_TIMEOUT
          If the connection hasn't been built in 30 seconds, give up
static int WRITE_BUFFER_SIZE
           
 
Constructor Summary
ConnectionBuilder(RouterContext context, TCPTransport transport, RouterInfo info)
           
 
Method Summary
 TCPConnection establishConnection()
          Blocking call to establish a TCP connection to the given peer through a brand new socket.
 java.lang.String getError()
          Brief description of why the connection failed (or null if it succeeded)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_TIMEOUT

public static final int CONNECTION_TIMEOUT
If the connection hasn't been built in 30 seconds, give up

See Also:
Constant Field Values

WRITE_BUFFER_SIZE

public static final int WRITE_BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

ConnectionBuilder

public ConnectionBuilder(RouterContext context,
                         TCPTransport transport,
                         RouterInfo info)
Method Detail

establishConnection

public TCPConnection establishConnection()
Blocking call to establish a TCP connection to the given peer through a brand new socket.

Returns:
fully established but not yet running connection, or null on error

getError

public java.lang.String getError()
Brief description of why the connection failed (or null if it succeeded)