Make a socket for testing and close it when done