diff --git a/gping.py b/gping.py index 7592db0..2f09a79 100644 --- a/gping.py +++ b/gping.py @@ -204,7 +204,12 @@ class GPing: self.pings[packet_id]['delay'] = time_received - time_sent # i'd call that a success - self.pings[packet_id]['success'] = True + if code == 0: + self.pings[packet_id]['success'] = True + else + self.pings[packet_id]['success'] = False + + self.pings[packet_id]['code'] = code # call our callback if we've got one self.pings[packet_id]['callback'](self.pings[packet_id])