java.lang.Object
net.i2p.router.transport.udp.UDPReceiver
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 Summary
ConstructorsConstructorDescriptionUDPReceiver(RouterContext ctx, UDPTransport transport, DatagramSocket socket, String name, SocketListener lsnr) Constructor name parameter.Method Summary
All Methods
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 statisticstransport- the transport whose PacketHandler queue receives the inbound packetssocket- the bound datagram socket the receiver thread reads fromname- the thread name to give the receiver threadlsnr- 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.