From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 25 14:12:07 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF7A1106564A for ; Tue, 25 Sep 2012 14:12:07 +0000 (UTC) (envelope-from tretuliy2@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 93C098FC12 for ; Tue, 25 Sep 2012 14:12:07 +0000 (UTC) Received: by pbbrp8 with SMTP id rp8so225957pbb.13 for ; Tue, 25 Sep 2012 07:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=+IEBdVwIP+8h2xaakfqEBtLc3PUYyxn3E6bCAl8ol/4=; b=cozcdaUrW//o8xPCEj4TT8W7og5Pb4m/sTu24eHzYbp3njKhxLpA4bc9eOz4umc5PB LFos7e41fY4wf4jYhW3klIbxN03cSLRS4sYZxOYoQm/L1iHf9j/v5OP0KRIWy3pVyUyH B8LL+q3NZw3OaOQq4BtfuLOQy3mc0lAQmeLcZzxK2I/GyLKJzERyNbU9/NsxRihV9hAx PzWmU2rkVlAf3Um3kxV5rYMyWw5L4fbiIbDrzQaFS7iCHbrRx3I921g3OQiXos/vulf7 0H2hYIa3A94dGe94xDcxOLMtIesv0mUQQB/O+zFDlkpZTLWc2RkYGraiiL1LdvY0LHtc 8w4w== MIME-Version: 1.0 Received: by 10.68.242.97 with SMTP id wp1mr46864949pbc.159.1348582327160; Tue, 25 Sep 2012 07:12:07 -0700 (PDT) Received: by 10.66.156.170 with HTTP; Tue, 25 Sep 2012 07:12:07 -0700 (PDT) Date: Tue, 25 Sep 2012 17:12:07 +0300 Message-ID: From: =?KOI8-R?B?98HEyc0g9dLB2sHF1w==?= To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: NgAllocRecvMsg() hangs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2012 14:12:07 -0000 Hi all. I don`t know if it`s write place to write, sorry if it`s not. I am trying to write some application that uses netgraph framework, and stuck on getting information from ng_ksocket node. It is server ng_ksocket node that clones itself on each connection (client), I get this cloned nodes id (something like [4ab]:) and store it in array. I want from time to time check if somebody connected to each of this nodes, and for that I am trying to use something like that : if (NgSendMsg(csock, pth, NGM_KSOCKET_COOKIE, NGM_KSOCKET_GETPEERNAME, NULL, 0) == -1) { if (errno == ENOTCONN) { syslog(LOG_INFO, "check_and_clear(): Socket not connected, node: %s will be shutdown", pth); ShutNode(pth); memset(clients[i], 0, sizeof(clients[i])); } else if (errno == ENOENT) { syslog(LOG_NOTICE, "check_and_clear(): Node already closed %s", pth); memset(clients[i], 0, sizeof(clients[i])); } else { syslog(LOG_ERR, "check_and_clear(): An error has occured while getpeername from node: %s, %s", pth, strerror(errno)); } }