This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


I am working on an application that needs to run on both Windows and
Linux platforms, and in order to do that I use mono (i.e. .Net).

For the snmp-functionality of that application I use net-snmp, since it
comes in both flavors as well. But I run into the following issue, when
using asynch operations:

I must call snmp_select_info and then call select on the returned
fd_set, but this is a strictly posix approach, ergo I cannot call select
from the .net environment.
I wonder why this approach was chosen? It makes more sense to me to
handle the select in net-snmp, since an application doing asynch
operations is not interested in the specific fd's involved, it wants to
be woken up when data has arrived as is done in the snmp_read call.

So I implemented this, and it seems to work fine. I am just wondering if
I am missing some details why this approach is false, and if my
implementation is not violating your architecture, how do we proceed
from here.

Finally my changes:
in snmp_api.c I introduced a new function snmp_asynch_read (of course
this should be implemented differently, for one it should check wether a
callback is provided for this session, and snmp_select_info could be
skipped by getting the data directly from the session):

* Loop over this function untill all data has been
* recieved (-1 is returned).
* returns 0 if success, -1 if fail
int rc = 0; //Success
int numfds = 0;
int block = 0;

fd_set fdset;

struct timeval timeout;

snmp_select_info(&numfds, &fdset, &timeout, &block);
numfds = select(numfds, &fdset, NULL, NULL, block?NULL:&timeout);

if (numfds > 0)
} else {
rc = -1; //'fail'

return rc;

Kind Regards,

Erik van Veelen
Senior (embedded) software engineer
AimValley B.V.

This message has been scanned for viruses and is believed to be clean

Content-Type: text/x-vcard; charset=utf-8;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;

fn:Erik van Veelen
n:van Veelen;Erik
adr:;;Anton Philipsweg 1;Hilversum;;1223 KZ;the Netherlands
title:Software Engineer
tel;work:+31 35 689 1929
tel;fax:+31 35 689 1901
note:Kind regards,

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

This email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Net-snmp-coders mailing list