parameters: (self)
docstring: Try to create a socket, using an exponential backoff with
          a max retry time. Thanks to Robert Olson for the original patch
          (SF #815911) which has been slightly refactored.
docstring_summary: Try to create a socket, using an exponential backoff with
          a max retry time. Thanks to Robert Olson for the original patch
          (SF #815911) which has been slightly refactored.
docstring_tokens: Try to create a socket using an exponential backoff with a max retry time . Thanks to Robert Olson for the original patch ( SF #815911 ) which has been slightly refactored .
function: def createSocket(self):
          """
          Try to create a socket, using an exponential backoff with
          a max retry time. Thanks to Robert Olson for the original patch
          (SF #815911) which has been slightly refactored.
          """
          now = time.time()
          # Either retryTime is None, in which case this
          # is the first time back after a disconnect, or
          # we've waited long enough.
          if self.retryTime is None:
              attempt = 1
          else:
              attempt = (now >= self.retryTime)
          if attempt:
              try:
                  self.sock = self.makeSocket()
                  self.retryTime = None # next time, no delay before trying
              except socket.error:
                  #Creation failed, so set the retry time and return.
                  if self.retryTime is None:
                      self.retryPeriod = self.retryStart
                  else:
                      self.retryPeriod = self.retryPeriod * self.retryFactor
                      if self.retryPeriod > self.retryMax:
                          self.retryPeriod = self.retryMax
                  self.retryTime = now + self.retryPeriod
function_tokens: def createSocket ( self ) : now = time . time ( ) # Either retryTime is None, in which case this # is the first time back after a disconnect, or # we've waited long enough. if self . retryTime is None : attempt = 1 else : attempt = ( now >= self . retryTime ) if attempt : try : self . sock = self . makeSocket ( ) self . retryTime = None # next time, no delay before trying except socket . error : #Creation failed, so set the retry time and return. if self . retryTime is None : self . retryPeriod = self . retryStart else : self . retryPeriod = self . retryPeriod * self . retryFactor if self . retryPeriod > self . retryMax : self . retryPeriod = self . retryMax self . retryTime = now + self . retryPeriod