DHT and Socket Refactoring

Do not destroy context if socket test fails