## net.i2p.router.transport.ntcp
Class NTCPTransport

    java.lang.Object
      net.i2p.router.transport.TransportImpl
          net.i2p.router.transport.ntcp.NTCPTransport

All Implemented Interfaces:
  Transport

    public class NTCPTransport

extends TransportImpl

Field Summary
`static java.lang.String` `STYLE`

Fields inherited from class net.i2p.router.transport.TransportImpl
`_context`

Constructor Summary
`NTCPTransport(RouterContext ctx)`

Method Summary
`void` `afterSend(OutNetMessage msg, boolean sendSuccessful, boolean allowRequeue, long msToSend)` The transport is done sending this message.
`TransportBid` `bid(RouterInfo toAddress, long dataSize)`
`int` `countActivePeers()` How many peers can we talk to right now?
`int` `countActiveSendPeers()` How many peers are we actively sending messages to (this minute)
`(package private) void` `establishing(NTCPConnection con)` add us to the establishment timeout process
`(package private) void` `expireTimedOut()` called in the EventPumper no more than once a second or so, closing any unconnected/unestablished connections
`java.util.Vector` `getClockSkews()` Return our peer clock skews on this transport.
`(package private) EventPumper` `getPumper()`
`(package private) Reader` `getReader()`
`java.lang.String` `getStyle()`
`(package private) Writer` `getWriter()`
`(package private) void` `inboundEstablished(NTCPConnection con)`
`boolean` `isBacklogged(Hash dest)`
`protected void` `outboundMessageReady()` This message is called whenever a new message is added to the send pool, and it should not block
`(package private) void` `removeCon(NTCPConnection con)`
`void` `renderStatusHTML(java.io.Writer out, int sortFlags)`
`void` `renderStatusHTML(java.io.Writer out, java.lang.String urlBase, int sortFlags)`
`RouterAddress` `restartListening(RouterAddress addr)`
`(package private) void` `sendComplete(OutNetMessage msg)`
`RouterAddress` `startListening()`
`void` `stopListening()`

Methods inherited from class net.i2p.router.transport.TransportImpl
`afterSend, afterSend, afterSend, getContext, getCurrentAddress, getMostRecentErrorMessages, getNextMessage, getReachabilityStatus, isPubliclyRoutable, isUnreachable, markReachable, markUnreachable, messageReceived, recheckReachability, renderStatusHTML, replaceAddress, send, setListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### STYLE

    public static final java.lang.String STYLE

See Also:
  Constant Field Values

Constructor Detail

### NTCPTransport

    public NTCPTransport(RouterContext ctx)

Method Detail

### inboundEstablished

    void inboundEstablished(NTCPConnection con)

### outboundMessageReady

    protected void outboundMessageReady()

  Description copied from class: `TransportImpl`
  This message is called whenever a new message is added to the send pool, and it should not block

  Specified by:
    `outboundMessageReady` in class `TransportImpl`

### afterSend

    public void afterSend(OutNetMessage msg,
                          boolean sendSuccessful,
                          boolean allowRequeue,
                          long msToSend)

  Description copied from class: `TransportImpl`
  The transport is done sending this message. This is the method that actually does all of the cleanup - firing off jobs, requeueing, updating stats, etc.

  Overrides:
    `afterSend` in class `TransportImpl`
  Parameters:
    `msg` - message in question
    `sendSuccessful` - true if the peer received it
    `allowRequeue` - true if we should try other transports if available
    `msToSend` - how long it took to transfer the data to the peer

### bid

    public TransportBid bid(RouterInfo toAddress,
                            long dataSize)

### sendComplete

    void sendComplete(OutNetMessage msg)

### isBacklogged

    public boolean isBacklogged(Hash dest)

  Specified by:
    `isBacklogged` in interface `Transport`
  Overrides:
    `isBacklogged` in class `TransportImpl`

### removeCon

    void removeCon(NTCPConnection con)

### countActivePeers

    public int countActivePeers()

  How many peers can we talk to right now?

  Specified by:
    `countActivePeers` in interface `Transport`
  Overrides:
    `countActivePeers` in class `TransportImpl`

### countActiveSendPeers

    public int countActiveSendPeers()

  How many peers are we actively sending messages to (this minute)

  Specified by:
    `countActiveSendPeers` in interface `Transport`
  Overrides:
    `countActiveSendPeers` in class `TransportImpl`

### getClockSkews

    public java.util.Vector getClockSkews()

  Return our peer clock skews on this transport. Vector composed of Long, each element representing a peer skew in seconds.

  Specified by:
    `getClockSkews` in interface `Transport`
  Overrides:
    `getClockSkews` in class `TransportImpl`

### startListening

    public RouterAddress startListening()

### restartListening

    public RouterAddress restartListening(RouterAddress addr)

### getReader

    Reader getReader()

### getWriter

    Writer getWriter()

### getStyle

    public java.lang.String getStyle()

### getPumper

    EventPumper getPumper()

### establishing

    void establishing(NTCPConnection con)

  add us to the establishment timeout process

### expireTimedOut

    void expireTimedOut()

  called in the EventPumper no more than once a second or so, closing any unconnected/unestablished connections

### stopListening

    public void stopListening()

### renderStatusHTML

    public void renderStatusHTML(java.io.Writer out,
                                 int sortFlags)
                          throws java.io.IOException

  Throws:
    `java.io.IOException`

### renderStatusHTML

    public void renderStatusHTML(java.io.Writer out,
                                 java.lang.String urlBase,
                                 int sortFlags)
                          throws java.io.IOException

  Specified by:
    `renderStatusHTML` in interface `Transport`
  Overrides:
    `renderStatusHTML` in class `TransportImpl`
  Throws:
    `java.io.IOException`