kyan001/ping3

return Dest IP in the ping result

mendoor opened this issue · 1 comments

Currently the ping3 only returns the delay in receive_one_ping(), but sometimes the dest ip address can be made of some usage too, so, is it possible to return the dest ip address as well?
I think a little change will be enough
init.py Line 250, current code is:
return time_recv - time_sent

change the line to:
return time_recv - time_sent, addr [0]

Hi @mendoor ,

I agree on the idea of "function returns with dest ip address would be better". It is a small change in code, but it's actually a big change on code logic. I have to carefully review this type of request.

Instead of changing the package code itself, how about create a new function wrap ping() and returns both delay and the dest address? It can be something like this:

def rping(dest_addr):  # add *args and **kwargs for more options.
    return ping(dest_addr), dest_addr

Thanks for your feedback. Feel free to leave a message for future discussion.