=========================
Using Unix-domain sockets
=========================

Passing a string to start causes it to bind to a Unix-domain socket.

Let's set up logging so we can see what's happening:

    >>> import logging
    >>> import os
    >>> import stat
    >>> import time
    >>> import zc.monitor
    >>> import zope.testing.loggingsupport

    >>> loghandler = zope.testing.loggingsupport.InstalledHandler(
    ...     None, level=logging.INFO)

Passing a path as the argument to start causes a Unix socket to be bound:

    >>> path = "testing.sock"

    >>> zc.monitor.start(path)
    'testing.sock'

    >>> m1 = os.stat(path)
    >>> stat.S_ISSOCK(m1.st_mode)
    True

Attempting to start the monitor at the same path again succeeds, but
causes a new socket to be created:

    >>> zc.monitor.start(path)
    'testing.sock'

    >>> m2 = os.stat(path)
    >>> stat.S_ISSOCK(m2.st_mode)
    True

    >>> m1.st_ino == m2.st_ino
    False

Clean up:

    >>> os.unlink(path)
    >>> loghandler.uninstall()
