def __init__(self, listenUrl): WebSocketServerFactory.__init__(self, listenUrl) # List of connected websocket clients self.clients = [] # List of received smartplug data self.smartplugs = {}
def __init__(self): WebSocketServerFactory.__init__(self) logging.debug("Using WebSocket module " + str(self.server)) self.openHandshakeTimeout = 20 self.closeHandshakeTimeout = 5 self.clients = [] # for broadcast
def __init__(self, config, *args, **kwargs): WebSocketServerFactory.__init__(self, *args, **kwargs) for module_name, module_data in config["modules"].items(): module_import_name = re.sub('(?!^)([A-Z]+)', r'_\1', module_data["type"]).lower() self.modules[module_name] = module_data module_module = importlib.import_module("modules."+module_import_name) module_object = getattr(module_module, module_data["type"]) self.modules[module_name]["module_object"] = module_object(**module_data)
def __init__(self): WebSocketServerFactory.__init__(self) logging.debug("Using WebSocket module " + str(self.server)) from mdbapi.server import cfg self.openHandshakeTimeout = cfg.websocket.opentimeout self.closeHandshakeTimeout = cfg.websocket.closetimeout self.clients = [] # for broadcast
def __init__(self, url, config="config.json", *args, **kwargs): WebSocketServerFactory.__init__(self, url, *args, **kwargs) self.clients = [] with open(config) as configfile: self.config.update(json.load(configfile)) self.config['switchModule'] = importlib.import_module(self.config['switchModule']) for name in self.config["switches"]: switch_config = self.config['switches'][name] switch_class = switch_config['class'] initial_data = switch_config switch = getattr(self.config["switchModule"], switch_class)(initial_data=initial_data, name=name, factory=self) self.config['switches'][name]['class'] = switch
def __init__(self, config_file): # init before get called self.contexts = {} self.context_subscriptions = {} Application.__init__(self, config_file) WebSocketServerFactory.__init__(self) #greenlet.greenlet.__init__(self) # start the separate tasker process IN.tasker.start_the_process()
def __init__(self, socketAddress, socketPort): WebSocketServerFactory.__init__(self, u"ws://%s:%d" % (socketAddress, socketPort), False) self.protocol = ProtocolHandler # Lets keep track of the address and port for use later. self.socketAddress = socketAddress self.socketPort = socketPort # Some stuff for the protocol... self.activeConnections = [] self.generatedSnakes = [] self.maxSnakeId = 100 self.timestamp = 0 self.snakeTravelSpeed = 10 self.generatedFood = []
def __init__(self): WebSocketServerFactory.__init__(self) self.state = { "current_song": None, "queue": [], "playing": True, "magic_mode": True, "duration_limit": None, "history": [] } self.clients = []
def __init__(self): WebSocketServerFactory.__init__(self) logging.debug("Using WebSocket module " + str(self.server)) from mdbapi.server import cfg self.openHandshakeTimeout = cfg.websocket.opentimeout self.closeHandshakeTimeout = cfg.websocket.closetimeout #logging.debug("openHandshakeTimeout = " + str(self.openHandshakeTimeout)) #logging.debug("closeHandshakeTimeout= " + str(self.closeHandshakeTimeout)) #logging.debug("autoPingTimeout = " + str(self.autoPingTimeout)) #logging.debug("autoPingInterval = " + str(self.autoPingInterval)) #logging.debug("server = " + str(self.server)) #logging.debug("isSecure = " + str(self.isSecure)) self.clients = [] # for broadcast
def __init__(self, url, debug=False, ident=None): if ident is not None: server = ident else: server = "AutobahnPython-Asyncio/%s" % autobahn.version WebSocketServerFactory.__init__(self, url, debug=debug, debugCodePaths=debug, server=server) self.setProtocolOptions(failByDrop=False) # spec conformance self.setProtocolOptions(failByDrop=True) # needed for streaming mode # self.setProtocolOptions(utf8validateIncoming = False) # enable permessage-deflate ## def accept(offers): for offer in offers: if isinstance(offer, PerMessageDeflateOffer): return PerMessageDeflateOfferAccept(offer) self.setProtocolOptions(perMessageCompressionAccept=accept)
def __init__(self, url): testee_ident = autobahn.asyncio.__ident__ self.log.info("Testee identification: {testee_ident}", testee_ident=testee_ident) WebSocketServerFactory.__init__(self, url, server=testee_ident) self.setProtocolOptions(failByDrop=False) # spec conformance # self.setProtocolOptions(utf8validateIncoming = False) if USE_STREAMING_TESTEE: self.setProtocolOptions(failByDrop=True) # needed for streaming mode else: # enable permessage-deflate WebSocket protocol extension def accept(offers): for offer in offers: if isinstance(offer, PerMessageDeflateOffer): return PerMessageDeflateOfferAccept(offer) self.setProtocolOptions(perMessageCompressionAccept=accept)
def __init__(self, url): testee_ident = autobahn.asyncio.__ident__ self.log.info("Testee identification: {testee_ident}", testee_ident=testee_ident) WebSocketServerFactory.__init__(self, url, server=testee_ident) self.setProtocolOptions(failByDrop=False) # spec conformance # self.setProtocolOptions(utf8validateIncoming = False) if USE_STREAMING_TESTEE: self.setProtocolOptions( failByDrop=True) # needed for streaming mode else: # enable permessage-deflate WebSocket protocol extension def accept(offers): for offer in offers: if isinstance(offer, PerMessageDeflateOffer): return PerMessageDeflateOfferAccept(offer) self.setProtocolOptions(perMessageCompressionAccept=accept)
def __init__(self, url, zmq_endpoint, server_type, debug=False, debugCodePaths=False): WebSocketServerFactory.__init__(self, url, debug=debug, debugCodePaths=debugCodePaths) self.tickcount = 0 self.server_type = server_type self.cleanClientsTimeout = 1 self.clientMaxTimeout = 30 self.statsTimeout = 1 self.clients = {} self.context = zmq.Context() self.recv_context = self.context.socket(zmq.PULL) self.recv_context.bind(zmq_endpoint) self.cycleTracker = [0] self.timeouts = [0] self.packetLoss = [0] self.messagesCount = 0
def __init__(self, *args): WebSocketServerFactory.__init__(self, *args) self.clients = []
def __init__(self, url, host, port, graph): print "INIT FACTORY" WebSocketServerFactory.__init__(self, url, host, port, graph) self.sib_host = host self.sib_port = port self.graph = graph
def __init__(self, url): WebSocketServerFactory.__init__(self, url) self.clients = [] self.tickcount = 0 self.tick()
def __init__(self, daq, **kwargs): WebSocketServerFactory.__init__(self, **kwargs) self.daq = daq self.clients = list()
def __init__(self, *args, **kwargs): WebSocketServerFactory.__init__(self, *args, **kwargs) self.clients = [] self.subscriptions = {}
def __init__(self, url, image_dir, session_age, restored_messages): WebSocketServerFactory.__init__(self, url) self._cookies = {} self.image_dir = image_dir self.session_max_age = session_age self.restored_messages = restored_messages
def __init__(self, url, callbacks, debug=False, debugCodePaths=False): WebSocketServerFactory.__init__(self, url, debug=debug, debugCodePaths=debugCodePaths) self.__callbacks = callbacks self.__clients = []
def __init__(self): WebSocketServerFactory.__init__(self, "ws://127.0.0.1:9000") self.clients = set() self.virtual_device = ServerVirtualDevice() self.device = self.virtual_device.get_device()
def __init__(self, url): WebSocketServerFactory.__init__(self, url) self.clients = []
def __init__(self, url, debug = False, debugCodePaths = False): WebSocketServerFactory.__init__(self, url, debug, debugCodePaths) self.clients = []
def __init__(self, url, debug=False, debugCodePaths=False): WebSocketServerFactory.__init__(self, url, debug=debug, debugCodePaths=debugCodePaths)
def __init__(self, verbose=False): WebSocketServerFactory.__init__(self) self.verbose = verbose self.clients = []
def __init__(self, url): WebSocketServerFactory.__init__(self, url)