- All Implemented Interfaces:
Runnable
This class periodically publishes the router's RouterInfo to the distributed network database (netdb) to ensure the router remains discoverable and reachable by other peers. Regular publication is essential for maintaining network connectivity and participation.
Publication Process:
- Retrieves current RouterInfo from router
- Validates RouterInfo integrity and timestamps
- Publishes to floodfill peers in network database
- Handles clock skew and timestamp issues
- Triggers identity rebuild if needed
Error Handling:
- Detects and handles clock skew issues
- Rebuilds router identity on validation failures
- Logs detailed error information for debugging
- Recovers from temporary network issues
Clock Skew Detection:
- Detects large time discrepancies (>60 seconds)
- Rebuilds RouterInfo with current time
- Prevents network database rejection
- Maintains router identity continuity
Network Integration:
- Ensures router remains discoverable by peers
- Maintains up-to-date routing information
- Supports network topology and routing
- Enables tunnel building and peer connections
Regular publication is critical for router participation in the I2P network. Without periodic republishing, routers would become unreachable and unable to participate in tunnel creation or network routing.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RouterContextThe router whose router info is republished.Fields inherited from class SimpleTimer2.TimedEvent
_state, DEFAULT_FUZZModifier and TypeFieldDescriptionprotected SimpleTimer2.TimedEventStateState of the current event.protected static final intDefault fuzz threshold in milliseconds.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidPublish the router's info to the network database.Methods inherited from class SimpleTimer2.TimedEvent
cancel, forceReschedule, reschedule, reschedule, run, schedule, setFuzz, setPool, toStringModifier and TypeMethodDescriptionbooleancancel()Cancel the timed event.voidforceReschedule(long timeoutMs) Always use the new time - ignores fuzz.voidreschedule(long timeoutMs) Use the earliest of the new time and the old time May be called from within timeReached(), but schedule() is better there.voidreschedule(long timeoutMs, boolean useEarliestTime) May be called from within timeReached(), but schedule() is better there.voidrun()voidschedule(long timeoutMs) Schedule this event.voidsetFuzz(int fuzz) Reschedule threshold in ms.voidsetPool(SimpleTimer2 pool) Timer pool for this event.toString()Timer summary for log messages.
Field Details
_context
The router whose router info is republished.
Constructor Details
Republish
Create a new router info republisher.- Parameters:
ctx- the router context for accessing router services
Method Details
timeReached
public void timeReached()Publish the router's info to the network database.Retrieves the current RouterInfo and publishes it to the netdb. If the RouterInfo is invalid (due to clock skew or other issues), attempts to rebuild the router identity.
This method handles clock skew detection and will trigger a router identity rebuild if significant time discrepancies are detected.
- Specified by:
timeReachedin classSimpleTimer2.TimedEvent