FMPingFoundationDelegate Protocol Reference

Conforms to NSObject
Declared in FMPingFoundation.h

– pingFoundation:didStartWithAddress:

A PingFoundation delegate callback, called once the object has started up.

- (void)pingFoundation:(FMPingFoundation *)pinger didStartWithAddress:(NSData *)address

Parameters

pinger

The object issuing the callback.

address

The address that’s being pinged; at the time this delegate callback is made, this will have the same value as the hostAddress property.

Discussion

A PingFoundation delegate callback, called once the object has started up.

This is called shortly after you start the object to tell you that the object has successfully started. On receiving this callback, you can call -sendPingWithData: to send pings.

If the object didn’t start, pingFoundation:didFailWithError: is called instead.

Declared In

FMPingFoundation.h

– pingFoundation:didFailWithError:

A PingFoundation delegate callback, called if the object fails to start up.

- (void)pingFoundation:(FMPingFoundation *)pinger didFailWithError:(NSError *)error

Parameters

pinger

The object issuing the callback.

error

Describes the failure.

Discussion

A PingFoundation delegate callback, called if the object fails to start up.

This is called shortly after you start the object to tell you that the object has failed to start. The most likely cause of failure is a problem resolving hostName.

By the time this callback is called, the object has stopped (that is, you don’t need to call -stop yourself).

Declared In

FMPingFoundation.h

– pingFoundation:didSendPacket:sequenceNumber:

A PingFoundation delegate callback, called when the object has successfully sent a ping packet.

- (void)pingFoundation:(FMPingFoundation *)pinger didSendPacket:(NSData *)packet sequenceNumber:(uint16_t)sequenceNumber

Parameters

pinger

The object issuing the callback.

packet

The packet that was sent; this includes the ICMP header (ICMPHeader) and the data you passed to -sendPingWithData: but does not include any IP-level headers.

sequenceNumber

The ICMP sequence number of that packet.

Discussion

A PingFoundation delegate callback, called when the object has successfully sent a ping packet.

Each call to -sendPingWithData: will result in either a -pingFoundation:didSendPacket:sequenceNumber: delegate callback or a pingFoundation:didFailToSendPacket:sequenceNumber:error: delegate callback (unless you stop the object before you get the callback). These callbacks are currently delivered synchronously from within -sendPingWithData:, but this synchronous behaviour is not considered API.

Declared In

FMPingFoundation.h

– pingFoundation:didFailToSendPacket:sequenceNumber:error:

A PingFoundation delegate callback, called when the object fails to send a ping packet.

- (void)pingFoundation:(FMPingFoundation *)pinger didFailToSendPacket:(NSData *)packet sequenceNumber:(uint16_t)sequenceNumber error:(NSError *)error

Parameters

pinger

The object issuing the callback.

packet

The packet that was not sent; see pingFoundation:didSendPacket:sequenceNumber: for details.

sequenceNumber

The ICMP sequence number of that packet.

error

Describes the failure.

Discussion

A PingFoundation delegate callback, called when the object fails to send a ping packet.

Each call to -sendPingWithData: will result in either a pingFoundation:didSendPacket:sequenceNumber: delegate callback or a -pingFoundation:didFailToSendPacket:sequenceNumber:error: delegate callback (unless you stop the object before you get the callback). These callbacks are currently delivered synchronously from within -sendPingWithData:, but this synchronous behaviour is not considered API.

Declared In

FMPingFoundation.h

– pingFoundation:didReceivePingResponsePacket:sequenceNumber:

A PingFoundation delegate callback, called when the object receives a ping response.

- (void)pingFoundation:(FMPingFoundation *)pinger didReceivePingResponsePacket:(NSData *)packet sequenceNumber:(uint16_t)sequenceNumber

Parameters

pinger

The object issuing the callback.

packet

The packet received; this includes the ICMP header (ICMPHeader) and any data that follows that in the ICMP message but does not include any IP-level headers.

sequenceNumber

The ICMP sequence number of that packet.

Discussion

A PingFoundation delegate callback, called when the object receives a ping response.

If the object receives an ping response that matches a ping request that it sent, it informs the delegate via this callback. Matching is primarily done based on the ICMP identifier, although other criteria are used as well.

Declared In

FMPingFoundation.h

– pingFoundation:didReceiveUnexpectedPacket:

A PingFoundation delegate callback, called when the object receives an unmatched ICMP message.

- (void)pingFoundation:(FMPingFoundation *)pinger didReceiveUnexpectedPacket:(NSData *)packet

Parameters

pinger

The object issuing the callback.

packet

The packet received; this includes the ICMP header (ICMPHeader) and any data that follows that in the ICMP message but does not include any IP-level headers.

Discussion

A PingFoundation delegate callback, called when the object receives an unmatched ICMP message.

If the object receives an ICMP message that does not match a ping request that it sent, it informs the delegate via this callback. The nature of ICMP handling in a BSD kernel makes this a common event because, when an ICMP message arrives, it is delivered to all ICMP sockets.

IMPORTANT: This callback is especially common when using IPv6 because IPv6 uses ICMP for important network management functions. For example, IPv6 routers periodically send out Router Advertisement (RA) packets via Neighbor Discovery Protocol (NDP), which is implemented on top of ICMP.

For more on matching, see the discussion associated with pingFoundation:didReceivePingResponsePacket:sequenceNumber:.

Declared In

FMPingFoundation.h