On Tue, 30 Aug 2005 15:54:32 +0200 Radek wrote:
RV> Now my understanding, which may well be incorrect, is that the callback
RV> function is used to handle a response to the trap? Is that correct? If
RV> so, why do we pass in a NULL pointer for the callback function?
First of all, traps do not get responses. Informs do, but traps do not.
Second, in the absence of user supplied callbacks, there are defaults.
RV> I know we expect a response because:
RV>
RV> a. I traced that with gdb
RV>
RV> We enter code:
RV>
RV> /*
RV> * Add to pending requests list if we expect a response.
RV> */
RV> if (pdu->flags & UCD_MSG_FLAG_EXPECT_RESPONSE) {
In that case, you must be sending an inform, and not a trap.
RV> b. I traced it with strace
RV>
RV> An strace of the app shows us doing a send(2) but no recv(2)
RV>
RV> An strace of snmpd shows us doing a recv(2) and then a send(2)
RV>
RV>
RV> An strace shows that we eventually hang, I have not checked this with
RV> crash(1) but I suspect it is because we are not draining the socket of the
RV> snmpd responses.
So what is consuming the resources, and what hangs? The app, or snmpd? Is the
app independent of snmpd, or is it a subagent?
RV> o we continue to hold memory because we never employ a callback to
RV> consume the response, which would also result in a freeing of
RV> associated resources
This doesn't make sense, because if it is an inform, the lack of a response
should cause resends, and then eventually a timeout, which should release
resources.
RV> o we eventually hang because we are not handling the response and
RV> therefore consume resources associated with the socket
Are you using tcp, or udp? The default is udp, and a full buffer should cause
dropped packets, not a hang. Tcp or domain sockets, on the other hand, could
hang on a full buffer.
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders