Cleaned up test_endpoint. Added two tests to test the try_sockets
method. It now actually works.