Package net.i2p.router.transport.ntcp
Class OutboundEstablishState
- java.lang.Object
-
- net.i2p.router.transport.ntcp.EstablishBase
-
- net.i2p.router.transport.ntcp.OutboundEstablishState
-
- All Implemented Interfaces:
EstablishState
class OutboundEstablishState extends EstablishBase
NTCP 1 only. We are Alice.- Since:
- 0.9.35 pulled out of EstablishState
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.i2p.router.transport.ntcp.EstablishBase
EstablishBase.State
-
-
Field Summary
-
Fields inherited from class net.i2p.router.transport.ntcp.EstablishBase
_con, _context, _curDecrypted, _dh, _e_bobSig, _e_hXY_tsB, _hX_xor_bobIdentHash, _log, _peerSkew, _prevEncrypted, _received, _state, _stateLock, _transport, _tsA, _tsB, _X, _Y, AES_SIZE, FAILED, HXY_SIZE, HXY_TSB_PAD_SIZE, MAX_RI_SIZE, MIN_RI_SIZE, STATES_DONE, VERIFIED, XY_SIZE
-
-
Constructor Summary
Constructors Constructor Description OutboundEstablishState(RouterContext ctx, NTCPTransport transport, NTCPConnection con)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getVersion()
Get the NTCP versionvoid
prepareOutbound()
We are Alice.void
receive(ByteBuffer src)
Parse the contents of the buffer as part of the handshake.protected void
releaseBufs(boolean isVerified)
Only call once.-
Methods inherited from class net.i2p.router.transport.ntcp.EstablishBase
_x, changeState, close, fail, fail, fail, isComplete, isCorrupt, prefix, toString, xor32
-
-
-
-
Constructor Detail
-
OutboundEstablishState
public OutboundEstablishState(RouterContext ctx, NTCPTransport transport, NTCPConnection con)
-
-
Method Detail
-
receive
public void receive(ByteBuffer src)
Parse the contents of the buffer as part of the handshake. All data must be copied out of the buffer as Reader.processRead() will return it to the pool. If there are additional data in the buffer after the handshake is complete, the EstablishState is responsible for passing it to NTCPConnection.- Specified by:
receive
in interfaceEstablishState
- Overrides:
receive
in classEstablishBase
-
getVersion
public int getVersion()
Get the NTCP version- Specified by:
getVersion
in interfaceEstablishState
- Specified by:
getVersion
in classEstablishBase
- Returns:
- 1
- Since:
- 0.9.35
-
prepareOutbound
public void prepareOutbound()
We are Alice. We are establishing an outbound connection, so prepare ourselves by queueing up the write of the first part of the handshake This method sends message #1 to Bob.- Specified by:
prepareOutbound
in interfaceEstablishState
- Overrides:
prepareOutbound
in classEstablishBase
- Throws:
IllegalStateException
-
releaseBufs
protected void releaseBufs(boolean isVerified)
Only call once. Caller must synch.- Overrides:
releaseBufs
in classEstablishBase
- Since:
- 0.9.16
-
-