Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Dec : Re: Receiving SNMP-Traps

www.cryer.info
Managed Newsgroup Archive

Re: Receiving SNMP-Traps

Subject:Re: Receiving SNMP-Traps
Posted by:"Lukas Gebauer" (gebaue..@mlp.cz)
Date:Wed, 2 Jan 2008 12:13:42

Stefan Paege wrote:
> Hi,
>
> I need to receive SNMP-Traps in one of my apps. While I have
> successfully used Synapse to send SNMP-Traps I'm not sure I understand
> how to receive Traps without missing data.
> As Synapse uses blocking sockets I guess I should put the calls to
> RecvTrap() into a thread of its own. So far so good. What puzzles me is
> that inside the classless RecvTrap() function a TSNMPSend object is
> created and as soon as it has received a trap data packet this object is
> destroyed again. The classless function returns the trap data.
> So while I handle the trap data in my app any incoming SNMP traps are
> not handled because noone is listening on UDP port 162. Even if I do a
> new call to RecvTrap() as soon as possible there is still a small
> timeframe where a SNMP packet could arrive without being handled.
>
> Is it just me who doesn't see the forest for the trees or is this a
> faulty design in Synapse? Any comments are welcome. Thanks.

It is not faulty design, but is is your faulty usage!

All about SNMP are implemented inside TSnmpSend class, including
receiving of traps!

See what is written in documentation about RecvTrap function: "This is
SAMPLE"! Here you can see how to use TSnmpSend class for receiving
traps. Just use it in similar form, just inside your loop with one
common TSnmpSend instance.

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive