java.lang.Object
net.i2p.i2ptunnel.udp.I2PSource
All Implemented Interfaces:
Source

public class I2PSourceextends Object implements Source
I2P source implementation for streaming data. Refactored in 0.9.53 to support I2CP protocols and ports.
  • Field Details

    • sess

      protected final I2PSession sess
      The I2P session.
    • sink

      protected Sink sink
      The sink to receive datagrams.
    • protocol

      private final I2PSource.Protocol protocol
      UDP protocol (unencrypted or encrypted).
    • port

      private final int port
      Local UDP port.
    • diss

      private final I2PDatagramDissector diss
      Datagram dissector for parsing I2P UDP frames.
    • log

      private final Log log
      Logger for this tunnel's datagram traffic.
  • Constructor Details

    • I2PSource

      public I2PSource(I2PSession sess)
      Creates a source handling both repliable and raw datagrams on all ports.
      Parameters:
      sess - the I2P session to listen on
    • I2PSource

      public I2PSource(I2PSession sess, I2PSource.Protocol protocol)
      Creates a source listening on all I2CP ports for the specified protocol.
      Parameters:
      sess - the I2P session to listen on
      protocol - REPLIABLE, RAW, or BOTH
    • I2PSource

      public I2PSource(I2PSession sess, I2PSource.Protocol protocol, int port)
      Creates a source listening on the specified port for the specified protocol.
      Parameters:
      sess - the I2P session to listen on
      protocol - REPLIABLE, RAW, or BOTH
      port - I2CP port, or I2PSession.PORT_ANY for all ports
  • Method Details

    • setSink

      public void setSink(Sink sink)
      Sets the sink for received I2P datagrams.
      Specified by:
      setSink in interface Source
      Parameters:
      sink - the sink to receive datagrams
    • start

      public void start()
      Starts the source to begin receiving datagrams.
      Specified by:
      start in interface Source