def __init__(self, HOST='localhost', PORT=4000, handler=KodemonUDPHandler, db_conn_string='sqlite:///AppData/Kodemon.sqlite'):
        #Set up the server
        UDPServer.__init__(self, (HOST, PORT), handler)

        #Set up the database connection
        engine = create_engine(db_conn_string)
        self.Session = sessionmaker(bind=engine)
Beispiel #2
0
 def __init__(self, server_address, RequestHandlerClass):
     UDPServer.__init__(self, server_address, RequestHandlerClass)
     self._shutdown_request = False
     
     # watchdog guards against the failure mode when the remote target fails 
     # to send any packets. If the watchdog reaches the high water mark, the 
     # server is terminated so as not to leave the server thread unterminated
     self.watchdog = 0.0
Beispiel #3
0
 def __init__(self,
              cdn_name,
              port,
              server_address,
              handler_class=DNSUDPHandler):
     self.name = cdn_name
     UDPServer.__init__(self, server_address, handler_class)
     return
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        """
        Initiate the server
        """

        UDPServer.__init__(self, *args, **kwargs)

        self.data = []
Beispiel #5
0
 def __init__(self,
              server_address,
              RequestHandlerClass,
              container,
              thread_class=Thread):
     UDPServer.__init__(self, server_address, RequestHandlerClass)
     CustomThreadingMixIn.__init__(self, thread_class)
     self.container = container
     self.daemon_threads = True
Beispiel #6
0
 def __init__(self, server_address, RequestHandlerClass, nametodns,
              nameservers, ipv6, log):
     self.nametodns = nametodns
     self.nameservers = nameservers
     self.ipv6 = ipv6
     self.address_family = AF_INET6 if self.ipv6 else AF_INET
     self.log = log
     UDPServer.__init__(self, server_address, RequestHandlerClass)
     self.daemon = True
Beispiel #7
0
 def __init__(self):
     threading.Thread.__init__(self)
     UDPServer.__init__(self,('0.0.0.0',1900),ssdpRequestHandler,False)
     self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     #self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
     addr = socket.inet_aton(SSDP_ADDR)
     interface = socket.inet_aton('0.0.0.0')
     cmd = socket.IP_ADD_MEMBERSHIP
     self.socket.setsockopt(socket.IPPROTO_IP, cmd, addr + interface)
     self.socket.bind(('0.0.0.0', SSDP_PORT))
     self.socket.settimeout(1)
Beispiel #8
0
    def __init__ (self):   
        from app import APP
        port = APP.BE.LOGGING._i_server_port

        UDPServer.__init__(self, ('127.0.0.1', port), None)
        Process.__init__ (self, None, None, "pcLOG" )        
        
        self.queue = Queue( APP.BE.LOGGING._i_queue_size )        
        self.backend = LoggingBackend (self.queue)
        self.backend.start()
        self.on = True
        self.start()
Beispiel #9
0
    def __init__(self, regnancy_server_address):

        for port in xrange(12000, 25000):
            try:
                logging.info("UDPServer starts")
                UDPServer.__init__(self, ("", port), Handler)
                logging.info("UDPServer runs %i", port)
                break
            except:
                pass

        self.timeout = 0.05
        RegnancyUDPServer.regnancy_server_address = \
            regnancy_server_address
        self.running = True
Beispiel #10
0
    def __init__(self, args):
        """Instantiate an OSCServer.
        server_address ((host, port) tuple): the local host & UDP-port
        the server listens on
        """
        self.address_family = args.address_family

        self.args = args
        self.own_address = client_host, client_port = resolve_host(args.client_host, args.client_port, self.address_family, socket.AI_PASSIVE)
        self.chaosc_address = chaosc_host, chaosc_port = resolve_host(args.chaosc_host, args.chaosc_port, self.address_family)

        logger.info("binding to %s:%r", client_host, client_port)
        UDPServer.__init__(self, self.own_address, OSCRequestHandler)

        self.socket.setblocking(0)
        if hasattr(args, "subscribe") and args.subscribe:
            self.subscribe_me()

        self.callbacks = {}
Beispiel #11
0
 def __init__(self, address=("239.255.255.250", 1900), handler_class=SSDPHandler):
     
     
     self._notifications = list()
     self._scheduled_timers = list()
     
     UDPServer.__init__(self, address, handler_class, bind_and_activate = False)
     
     # needed to receive multicast messages
     mreq = struct.pack("=4sl", socket.inet_aton("239.255.255.250"), socket.INADDR_ANY)
     self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)         
     self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
     self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_LOOP, 1)
     
     
     self.notification_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
     
     
     self.server_bind()
     self.server_activate()
Beispiel #12
0
 def __init__(self, server_address, handler_class=UDPHandler):
     UDPServer.__init__(self, server_address, handler_class)
     return
Beispiel #13
0
 def __init__(self, server_address, RequestHandlerClass, container,
              thread_class = Thread):
     UDPServer.__init__(self, server_address, RequestHandlerClass)
     CustomThreadingMixIn.__init__(self, thread_class)
     self.container = container
     self.daemon_threads = True
Beispiel #14
0
 def __init__(self, addr):
     UDPServer.__init__(self, addr, SimpleUDPHandler)
 def __init__(self, **kwargs):
     host = kwargs.get('host', '127.0.0.1')
     port = int(kwargs.get('port', 8881))
     UDPServer.__init__(self, (host, port), WowzaHandler)
     self.db = DbLogger(**kwargs)
 def __init__(self, local_address = ('127.0.0.1', 69) ):
     UDPServer.__init__(self, local_address, None)
Beispiel #17
0
 def __init__(self, cdn_name, server_address, handler_class=DNSUDPHandler):
     self.name = cdn_name
     UDPServer.__init__(self, server_address, handler_class)
     return
Beispiel #18
0
	def __init__(self, host):
		UDPServer.__init__(self, (host,PORT), CLDAPHandler)
Beispiel #19
0
 def __init__(self, server_address, RequestHandlerClass, config):
     self.config = config
     UDPServer.__init__(self, server_address, RequestHandlerClass)