Open ttrmw opened 7 years ago
Thank you very much for that challenge @ttrmw. I will be honest. I had a quite hard time with providing a better solution. I was googling around, and I think I would possibly use Timeout::timeout. However, a little clue to push me in the right direction would be greatly appreciated.
For the time being, I have extracted socket instantiation to a separate method connection?
which I believe looks a little bit cleaner.
It isn't really necessary to instantiate a socket directly in order to check for a connection, can you think of a cleaner way to achieve correct error handling?