handling socket.error Exceptions, added api.sleep_repeat_call() method