Exemplo n.º 1
0
 def _init_multicast_endpoint(self):
     multicast_addr, multicast_port = urlparse(self.multicast_endpoint)\
         .netloc.split(':')
     try:
         self.udp_socket = create_udp_socket(multicast_addr, multicast_port)
         self.loop.add_handler(self.udp_socket.fileno(),
                               self.handle_autodiscover_message,
                               ioloop.IOLoop.READ)
     except (IOError, OSError, ValueError):
         message = ("Multicast discovery is disabled, there was an "
                    "error during udp socket creation.")
         logger.warning(message, exc_info=True)
Exemplo n.º 2
0
 def _init_multicast_endpoint(self):
     multicast_addr, multicast_port = urlparse(self.multicast_endpoint)\
         .netloc.split(':')
     try:
         self.udp_socket = create_udp_socket(multicast_addr,
                                             multicast_port)
         self.loop.add_handler(self.udp_socket.fileno(),
                               self.handle_autodiscover_message,
                               ioloop.IOLoop.READ)
     except (IOError, OSError, ValueError):
         message = ("Multicast discovery is disabled, there was an "
                    "error during udp socket creation.")
         logger.warning(message, exc_info=True)
Exemplo n.º 3
0
    def initialize(self):
        # initialize controller

        # Initialize ZMQ Sockets
        self.ctrl_socket = self.context.socket(zmq.ROUTER)
        self.ctrl_socket.bind(self.endpoint)
        self.ctrl_socket.linger = 0
        self._init_stream()

        # Initialize UDP Socket
        if self.multicast_endpoint:
            multicast_addr, multicast_port = urlparse(self.multicast_endpoint).netloc.split(":")
            self.udp_socket = create_udp_socket(multicast_addr, multicast_port)
            self.loop.add_handler(self.udp_socket.fileno(), self.handle_autodiscover_message, ioloop.IOLoop.READ)
Exemplo n.º 4
0
    def initialize(self):
        # initialize controller

        # Initialize ZMQ Sockets
        self.ctrl_socket = self.context.socket(zmq.ROUTER)
        self.ctrl_socket.bind(self.endpoint)
        self.ctrl_socket.linger = 0
        self._init_stream()

        # Initialize UDP Socket
        multicast_addr, multicast_port = urlparse(self.multicast_endpoint)\
            .netloc.split(':')
        self.udp_socket = create_udp_socket(multicast_addr, multicast_port)
        self.loop.add_handler(self.udp_socket.fileno(),
                              self.handle_autodiscover_message,
                              ioloop.IOLoop.READ)
Exemplo n.º 5
0
    def initialize(self):
        # initialize controller

        # Initialize ZMQ Sockets
        self.ctrl_socket = self.context.socket(zmq.ROUTER)
        self.ctrl_socket.bind(self.endpoint)
        self.ctrl_socket.linger = 0

        # support chown'ing the zmq endpoint on unix platforms
        if self.endpoint_owner_mode:
            uid = to_uid(self.endpoint_owner)
            sockpath = self.endpoint[6:]  # length of 'ipc://' prefix
            os.chown(sockpath, uid, -1)

        self._init_stream()

        # Initialize UDP Socket
        if self.multicast_endpoint:
            multicast_addr, multicast_port = urlparse(self.multicast_endpoint)\
                .netloc.split(':')
            self.udp_socket = create_udp_socket(multicast_addr, multicast_port)
            self.loop.add_handler(self.udp_socket.fileno(),
                                  self.handle_autodiscover_message,
                                  ioloop.IOLoop.READ)
Exemplo n.º 6
0
    def initialize(self):
        # initialize controller

        # Initialize ZMQ Sockets
        self.ctrl_socket = self.context.socket(zmq.ROUTER)
        self.ctrl_socket.bind(self.endpoint)
        self.ctrl_socket.linger = 0

        # support chown'ing the zmq endpoint on unix platforms
        if self.endpoint_owner_mode:
            uid = to_uid(self.endpoint_owner)
            sockpath = self.endpoint[6:]  # length of 'ipc://' prefix
            os.chown(sockpath, uid, -1)

        self._init_stream()

        # Initialize UDP Socket
        if self.multicast_endpoint:
            multicast_addr, multicast_port = urlparse(self.multicast_endpoint)\
                .netloc.split(':')
            self.udp_socket = create_udp_socket(multicast_addr, multicast_port)
            self.loop.add_handler(self.udp_socket.fileno(),
                                  self.handle_autodiscover_message,
                                  ioloop.IOLoop.READ)