java.lang.Object
net.i2p.i2ptunnel.streamr.MultiSource
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classSink wrapper for multi-source destinations.Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidadd(MultiSource.MSink ms) Range that receive each copy of the data.voidObject identity.voidsend(Destination ignoredFrom, int ignoredFromPort, int ignoredToPort, byte[] data) May throw RuntimeException from underlying sinks.voidSets the destination sink for all outgoing data.voidstart()Initializes the multi-source.voidstop()Stops the multi-source and clears all registered sinks.
Field Details
sink
Where the incoming data is sent.sinks
The listeners this source feeds.log
Logger for this class.
Constructor Details
MultiSource
public MultiSource()Creates a new multi-source distributor.
Method Details
setSink
start
stop
public void stop()Stops the multi-source and clears all registered sinks.send
May throw RuntimeException from underlying sinks.- Specified by:
sendin interfaceSink- Parameters:
ignoredFrom- some implementations may ignore, may be null in some implementationsignoredFromPort- I2CP source port, 0-65535ignoredToPort- I2CP destination port, 0-65535data- the datagram payload to deliver to the destination- Throws:
RuntimeException- if one of the registered sinks fails to send the data
add
Range that receive each copy of the data.- Parameters:
ms- the subscriber to deliver to, naming the destination and the port
remove
Object identity.- Parameters:
ms- the subscriber to drop; matched against the registered sinks by