Hi all,

As per my requirement I need to send pack of 1000 traps to my client 
continuously. For the first 3 times sending the traps is very fast. From the 
4th time it is taking very long time to send 1000 traps in one go.

What could be the reason? If any one knows kindly help me.

The following is my code

            SOCK_STARTUP;
            While(1)
{
snmp_sess_init(&session1);
      session1.version=0;
      session1.community=(u_char*)"public";
      session1.community_len=11;
      session1.peername="127.0.0.1";
      t= netsnmp_transport_open_client("snmptrap", session.peername);
      ss1 =snmp_add(&session,t,
              NULL, NULL);
      ss1->version=1;
      ss1->callback=snmp_input;
      ss1->sessid=1;
      pdu1=snmp_pdu_create(SNMP_MSG_INFORM);
      sysuptime = get_uptime();
      sprintf(csysuptime, "%ld", sysuptime);
      trap = csysuptime;
      snmp_add_var(pdu1, objid_sysuptime,sizeof(objid_sysuptime) / sizeof(oid), 
't', trap);
      snmp_add_var(pdu1, objid_snmptrap, sizeof(objid_snmptrap) / sizeof(oid),  
'o', ".1.3.6.1.3.1.8709.8.10.87.78");
      for(i=2;i<=1001;i++)
            {
      memset(ptr1,0,12);
      memcpy(name2,name1,14*4);
      name2[11]=(ULONG)i;
      itoa(rand(),ptr1,10);
      snmp_add_var(pdu1, name2, 13, 'i',ptr1);
            }
      status1 = snmp_synch_response(ss1, pdu1, &response1);
      if(response1)
               {
                snmp_free_pdu(response1);
                  printf("Thousand sent");
               }
      snmp_close(ss1);

      }
      SOCK_CLEANUP;


Thanks and Regards,

santhosh




________________________________
Important notice: This e-mail and any attachment there to contains corporate 
proprietary information. If you have received it by mistake, please notify us 
immediately by reply e-mail and delete this e-mail and its attachments from 
your system.
Thank You.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to