Did I find the right examples for you? yes no

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)
start monitor server.

Returns the listener address (which may be different from the
given address) if monitor server started; returns False if the
port is already in use; and raises an exception otherwise.

        def start(address):
    """start monitor server.

    Returns the listener address (which may be different from the
    given address) if monitor server started; returns False if the
    port is already in use; and raises an exception otherwise.
    """
    import zc.ngi.async

    ourAddress = None
    if isinstance(address, int):
        #a port is passed as int
        ourAddress = ('', address)
    elif isinstance(address, tuple):
        #an (address, port) tuple is passed
        ourAddress = address
    elif isinstance(address, basestring):
        #a unix domain socket string is passed
        ourAddress = address
        if os.path.exists(ourAddress):
            m = os.stat(ourAddress)
            if stat.S_ISSOCK(m.st_mode):
                os.unlink(ourAddress)

    try:
        global last_listener
        last_listener = zc.ngi.async.listener(ourAddress, Server)
    except socket.error, e:
        if e.args[0] == errno.EADDRINUSE:
            # Don't kill the process just because somebody else has our port.
            # This might be a zopectl debug or some other innocuous problem.
            # (Existing Unix-domain sockets are removed before binding, so
            # this doesn't work that way for those.  Use a separate offline
            # configuration in that case.)
            logging.warning(
                'unable to start zc.monitor server because the address %s '\
                'is in use.',
                ourAddress)
            return False
        else:
            raise
    return last_listener.address
        


src/z/c/zc.async-1.5.4/src/zc/async/examples/pi3.py   zc.async(Download)
            zope.component.provideUtility(
                f, zc.monitor.interfaces.IMonitorPlugin, f.__name__)
        zc.monitor.start(int(monitor_port))
    storage = ZEO.ClientStorage.ClientStorage(
        ('127.0.0.1', 9999))

src/z/c/zc.z3monitor-0.8.0/src/zc/z3monitor/__init__.py   zc.z3monitor(Download)
        #being backwards compatible here and not passing address if not given
        port = int(config['port'])
        zc.monitor.start(port)
    except KeyError:
        #new style bind
            if m:
                #we have an address:port
                zc.monitor.start((m.group('addr'), int(m.group('port'))))
                return
 
            m = re.match(r'^(?P<port>\d+)$', bind)
            if m:
                #we have a port
                zc.monitor.start(int(m.group('port')))
 
            #we'll consider everything else as a domain socket
            zc.monitor.start(bind)
        except KeyError:
            #no bind config no server

src/f/i/five.z2monitor-0.2/src/five/z2monitor/__init__.py   five.z2monitor(Download)
        #being backwards compatible here and not passing address if not given
        port = int(config['port'])
        zc.monitor.start(port)
    except KeyError:
        #new style bind
            if m:
                #we have an address:port
                zc.monitor.start((m.group('addr'), int(m.group('port'))))
                return
 
            m = re.match(r'^(?P<port>\d+)$', bind)
            if m:
                #we have a port
                zc.monitor.start(int(m.group('port')))
 
            #we'll consider everything else as a domain socket
            zc.monitor.start(bind)
        except KeyError:
            #no bind config no server

src/p/l/plone.app.async-1.6/src/plone/app/async/config.py   plone.app.async(Download)
            logger.info('Starting zc.monitor service on port %s',
                        config['port'])
            zc.monitor.start(int(config['port']))
 
 

src/z/c/zc.zkzopeserver-1.3.2/src/zc/zkzopeserver/__init__.py   zc.zkzopeserver(Download)
        global zc
        import zc.monitor
        props['monitor'] = "%s:%s" % zc.monitor.start((mhost, int(mport)))
 
    server.ZooKeeper = zc.zk.ZooKeeper(

src/z/c/zc.zkzeo-0.3.2/src/zc/zkzeo/runzeo.py   zc.zkzeo(Download)
                    maddr = maddr[0], 0
 
                maddr = zc.monitor.start(maddr)
                if isinstance(maddr, tuple):
                    props['monitor'] = "%s:%s" % maddr