Quantcast
Channel: C# Based Open Source SNMP Library for .NET and Mono
Viewing all articles
Browse latest Browse all 576

New Post: SnmpEngine close session when exting from method.

$
0
0
Dear all,

I'd created snmp windows service to retrive snmp packet by created as windows service applcation. code is following up from snmptrapd example project.

I'd removed "Console.Read()" to give application could be following by therad but after exit from method engine was unbinded from listener.

Does any one help kindly comment or sugguest me? how to continue "engine.start" to listening after exit method.

Thank you.
    public void serviceStart()
    {
        thStart = new Thread(engineStart);
        thStart.Start();
    }

    public void engineStart()
    {
        int_Address = ConfigurationManager.AppSettings["AgentIP"];
        portNo = ConfigurationManager.AppSettings["AgentPort"];
        target_Address = ConfigurationManager.AppSettings["TargetIP"];
        target_Port = ConfigurationManager.AppSettings["TargetPort"];
        using (engine = Container.Resolve<SnmpEngine>())
        {
            engine.Listener.AddBinding(new IPEndPoint(IPAddress.Parse(int_Address), Convert.ToInt32(portNo)));
            engine.Start();
        }
    }

Viewing all articles
Browse latest Browse all 576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>