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.
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();
}
}