RecentAddress Class Reference

#import <IPAddress.h>

Inherits IPAddress.

List of all members.


Detailed Description

An IPAddress that can keep track of statistics on when it was last sucessfully used and the number of successful attempts.

This is useful when keeping a cache of recent addresses for a peer that doesn't have a stable address.

Public Member Functions

(id) - initWithIPAddress:
 Initializes a RecentAddress from an IPAddress.
(BOOL) - noteSuccess
 Call this to indicate that the address was successfully used to connect to the desired peer.
(BOOL) - noteSeen
 Call this to indicate that you have received evidence that this address is currently being used by this peer.

Properties

readonly CFAbsoluteTime lastSuccess
 The absolute time that -noteSuccess or -noteSeen was last called.
readonly UInt32 successes
 The number of times that -noteSuccess has been called.


Member Function Documentation

- (id) initWithIPAddress: (IPAddress*)  addr  

Initializes a RecentAddress from an IPAddress.

(You can also initialize RecentAddress using any inherited initializer method.)

- (BOOL) noteSuccess  

Call this to indicate that the address was successfully used to connect to the desired peer.

Returns YES if the state of the object has changed and it should be re-archived.

- (BOOL) noteSeen  

Call this to indicate that you have received evidence that this address is currently being used by this peer.

Unlike -noteSuccess it doesn't increment -successes, and only returns YES (to indicate a persistent change) once every 18 hours (to avoid making the client save its cache too often.)


Property Documentation

- (readonly CFAbsoluteTime) lastSuccess

The absolute time that -noteSuccess or -noteSeen was last called.

- (readonly UInt32) successes

The number of times that -noteSuccess has been called.


The documentation for this class was generated from the following files:
Generated on Tue May 27 22:56:33 2008 for MYNetwork:MooseyardNetworking by  doxygen 1.5.4