parameters: (self)
docstring: Return the less loaded simulation server.
docstring_summary: Return the less loaded simulation server.
docstring_tokens: Return the less loaded simulation server .
function: def get(self):
          """Return the less loaded simulation server."""
          global LOAD_THRESHOLD
          global simulation_server_loads
          minimum = LOAD_THRESHOLD
          minimally_loaded_server = ''
          for i in range(len(config['simulationServers'])):
              if simulation_server_loads[i] >= LOAD_THRESHOLD:
                  continue
              if simulation_server_loads[i] < minimum:
                  minimum = simulation_server_loads[i]
                  minimally_loaded_server = config['simulationServers'][i]
          if minimum < LOAD_THRESHOLD:
              if config['ssl'] or config['portRewrite']:
                  protocol = 'wss:'
              else:
                  protocol = 'ws:'
              self.write(protocol + '//' + minimally_loaded_server)
              return
          self.write('Error: no simulation server available at the moment.')
function_tokens: def get ( self ) : global LOAD_THRESHOLD global simulation_server_loads minimum = LOAD_THRESHOLD minimally_loaded_server = '' for i in range ( len ( config [ 'simulationServers' ] ) ) : if simulation_server_loads [ i ] >= LOAD_THRESHOLD : continue if simulation_server_loads [ i ] < minimum : minimum = simulation_server_loads [ i ] minimally_loaded_server = config [ 'simulationServers' ] [ i ] if minimum < LOAD_THRESHOLD : if config [ 'ssl' ] or config [ 'portRewrite' ] : protocol = 'wss:' else : protocol = 'ws:' self . write ( protocol + '//' + minimally_loaded_server ) return self . write ( 'Error: no simulation server available at the moment.' )