Added a ping to reduce the number of socket connections required.