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, 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 intgetVersion()Get the NTCP versionvoidprepareOutbound()We are Alice.voidreceive(ByteBuffer src)Parse the contents of the buffer as part of the handshake.protected voidreleaseBufs(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:
receivein interfaceEstablishState- Overrides:
receivein classEstablishBase
-
getVersion
public int getVersion()
Get the NTCP version- Specified by:
getVersionin interfaceEstablishState- Specified by:
getVersionin 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:
prepareOutboundin interfaceEstablishState- Overrides:
prepareOutboundin classEstablishBase- Throws:
IllegalStateException
-
releaseBufs
protected void releaseBufs(boolean isVerified)
Only call once. Caller must synch.- Overrides:
releaseBufsin classEstablishBase- Since:
- 0.9.16
-
-