Added an option for synchronous pinging

Useful in debug and test scenarios