Catch socket.error exception.

By catching the specific socket.error exception we allow the Callback to
properly interrupt the task by raising a GeneratorExit exception.  Also,
it is good coding practice to specify the exception you want to catch.