java.lang.Object
net.i2p.router.transport.udp.UDPReceiver

class UDPReceiverextends Object
Receives raw UDP datagrams off the wire as fast as possible, controlled by the bandwidth limiter and the router's throttle. Pushes received packets into the PacketHandler queue.

There is a UDPReceiver for each UDPEndpoint. It contains a thread but no queue. Received packets are queued in the common PacketHandler queue.

  • Constructor Details

    • UDPReceiver

      public UDPReceiver(RouterContext ctx, UDPTransport transport, DatagramSocket socket, String name, SocketListener lsnr)
      Constructor name parameter.
      Parameters:
      ctx - the router context supplying the log and rate statistics
      transport - the transport whose PacketHandler queue receives the inbound packets
      socket - the bound datagram socket the receiver thread reads from
      name - the thread name to give the receiver thread
      lsnr - the socket listener that owns this receiver and supplies the endpoint
  • Method Details

    • startup

      public void startup()
      Cannot be restarted (socket is final).
    • shutdown

      public void shutdown()
      Stop the receiver thread and cease reading from the socket.