Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2012 17:12:07 +0300
From:      =?KOI8-R?B?98HEyc0g9dLB2sHF1w==?= <tretuliy2@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   NgAllocRecvMsg() hangs
Message-ID:  <CAAEEwq3xBy8aYwipDv8JiyMYFR-XWKyBdD6t4J1uRVnCTdbOKQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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));
}
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAEEwq3xBy8aYwipDv8JiyMYFR-XWKyBdD6t4J1uRVnCTdbOKQ>