def METHOD_NAME(self, primary = True):
    if not os.path.exists(self.crawl_socketpath):
        # Wait until the socket exists
        IOLoop.current().add_timeout(time.time() + 1, self.METHOD_NAME)
        return
    self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
    self.socket.setblocking(False)
    # Set close-on-exec
    flags = fcntl.fcntl(self.socket.fileno(), fcntl.F_GETFD)
    fcntl.fcntl(self.socket.fileno(), flags | fcntl.FD_CLOEXEC)
    self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    if (self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF) < 2048):
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2048)
    # on linux, the following may have no effect (setting SO_RCVBUF is
    # often documented as having no effect), but on other unixes, it
    # matters quite a bit. The choice of 212992 is based on the linux
    # default.
    if (self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF) < 212992):
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 212992)
    # Bind to a temp path
    # there's a race condition here...
    # note that mktmp here is deprecated, and we may eventually need to
    # do something different. One simple idea is to keep sockets in a
    # temporary directory generated from tempfile calls (i.e
    # tempfile.mkdtemp), but use our own naming scheme. Because this is a
    # socket, regular calls in tempfile are not appropriate.
    with warnings.catch_warnings():
        warnings.simplefilter("ignore")
        self.socketpath = tempfile.mktemp(dir=config.get('server_socket_path'),
                                          prefix="crawl", suffix=".socket")
    self.socket.bind(self.socketpath)
    # Install handler
    IOLoop.current().add_handler(self.socket.fileno(),
                                 self._handle_read,
                                 IOLoop.ERROR | IOLoop.READ)
    msg = json_encode({
            "msg": "attach",
            "primary": primary
            })
    self.open = True
    self.send_message(utf8(msg))