Roguelazer/send_nsca — pull request #1 by hvnsweeting (2014-03-20 08:40:44+00:00)
Title: Set timeout for socket before connect, not after

As the version before this fix took more than 2 minutes to timeout the connect to sockaddr.

````
time ./passive_check.py apt
Passive check apt exiting due to exception
Traceback (most recent call last):
File "./passive_check.py", line 138, in
main()
File "./passive_check.py", line 132, in main
sender.send_service(minion_id, check_name, status, output)
File "/usr/local/nagios/local/lib/python2.7/site-packages/send_nsca/nsca.py", line 351, in send_service
self.connect()
File "/usr/local/nagios/local/lib/python2.7/site-packages/send_nsca/nsca.py", line 391, in connect
conns = self._sock_connect(self.remote_host, self.port, self.timeout, connect_all=self.send_to_all)
File "/usr/local/nagios/local/lib/python2.7/site-packages/send_nsca/nsca.py", line 378, in _sock_connect
raise socket.error("could not connect to %s:%d" % (self.remote_host, self.port))
error: could not connect to 8.8.8.8:5667

real 2m9.115s
````