java.lang.Object
org.klomp.snark.dht.DatagramSender
Shared low-level datagram send path for the DHT and UDP tracker clients. Wraps the session send call with the common protocol selection (repliable datagrams on PROTO_DATAGRAM vs raw datagrams on PROTO_DATAGRAM_RAW), so the two transports cannot drift apart on port/protocol pairing.
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUtility class, not intended for instantiation.Method Summary
All MethodsModifier and TypeMethodDescriptionstatic booleansend(I2PSession session, SendMessageOptions opts, Destination dest, byte[] payload, int fromPort, int toPort, boolean repliable) Send a pre-wrapped datagram payload through the session.
Constructor Details
DatagramSender
private DatagramSender()Utility class, not intended for instantiation.
Method Details
send
public static boolean send(I2PSession session, SendMessageOptions opts, Destination dest, byte[] payload, int fromPort, int toPort, boolean repliable) throws I2PSessionException Send a pre-wrapped datagram payload through the session.- Parameters:
session- the session to send throughopts- the send options (date, lease set, crypto tags)dest- the destination to send topayload- the wrapped datagram payload, sent in fullfromPort- the port to send fromtoPort- the port to send torepliable- true for a repliable datagram (PROTO_DATAGRAM), false for raw- Returns:
- true if the session accepted the datagram for delivery
- Throws:
I2PSessionException- on session failure