java.lang.Object
net.i2p.i2ptunnel.socks.SOCKSUDPUnwrapper
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<I2PSocketAddress, SOCKSHeader> Headers remembered for each peer addressprivate SinkWhere the unwrapped datagram is passed on.Constructor Summary
ConstructorsConstructorDescriptionSOCKSUDPUnwrapper(Map<I2PSocketAddress, SOCKSHeader> cache) Hold the header cache that maps each unwrapped destination back to the SOCKS header its returning datagrams must be re-encased with.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidsend(Destination ignoredFrom, int fromPort, int toPort, byte[] data) May throw RuntimeException from underlying sink.voidSets the sink for outgoing unwrapped UDP datagrams.voidstart()Starts the unwrapper.
Field Details
sink
Where the unwrapped datagram is passed on.cache
Headers remembered for each peer address
Constructor Details
SOCKSUDPUnwrapper
Hold the header cache that maps each unwrapped destination back to the SOCKS header its returning datagrams must be re-encased with.- Parameters:
cache- put headers here to pass to SOCKSUDPWrapper
Method Details
setSink
start
send
May throw RuntimeException from underlying sink.- Specified by:
sendin interfaceSink- Parameters:
ignoredFrom- unused; the SOCKS header in the data supplies the destination instead, as this unwrapper never sends from itselffromPort- will be passed alongtoPort- the UDP port to send to, taken from the SOCKS header rather than from this argumentdata- the datagram payload to deliver to the destination- Throws:
RuntimeException- if the downstream sink fails to send the unwrapped data