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:"Stefan Paege" (pae..@notforme.el-carls.de)
Date:Wed, 2 Jan 2008 14:49:02

Lukas,

>> 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!

Sorry if the above sounds like an insult. I certainly hope I did not
offend you.

Regarding my problem: As long as I keep a TSnmpSend instance open and
call TSnmpSend.RecvTrap in a loop I do not loose any UDP packages,
correct? At least if my background thread has a high enough priority and
my machine is capable to handle the traffic.

Thanks again for providing Synapse!

Stefan


> 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.
>>
>
> 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.


--


Elektronik-Labor Carls GmbH & Co. KG

  Stefan Paege

Fon: +49 5973 9497-23
Fax: +49 5973 9497-19

----

Elektronik-Labor Carls GmbH & Co. KG
Kommanditgesellschaft:Sitz Neuenkirchen, Registergericht Steinfurt HRA 3310

Persönlich haftende Gesellschafterin: Elektronik-Labor Carls,
Beteiligungsgesellschaft mbH, Sitz Neuenkirchen, Registergericht
Steinfurt HRB 4175

Geschäftsführer: Irmgard Carls, Joachim Schulte

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive