Hi Frank,

Now we want to use the subagent 
org.snmp4j.agent.agentx.subagent.AgentXSubagent.java, and the same problem 
happens again and this time calling WorkerPool.stop() can't solve it.

For example, I tried

subagent.close(session, AgentXProtocol.REASON_SHUTDOWN);
subagent.getWorkerPool().stop();

or

workerPool = ThreadPool.create("AgentXSubAgent", 3);
subagent.setThreadPool(workerPool);
...

subagent.close(session, AgentXProtocol.REASON_SHUTDOWN);
workerPool.stop(); 

Could you advise please?

Thanks,
Jesse


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf 
Of Frank Fock
Sent: 17 January 2012 00:37
To: [email protected]
Subject: Re: [SNMP4J] How to completely exit from agent?

Hi Jesse,

After calling AgentConfigManager.shutdown() you should also call 
WorkerPool.stop() on the WorkerPool you provided in the constructor of the 
AgentConfigManager.
This, of course, only applies to thread pools that are under your control and 
stoppable.

Best regards,
Frank

Am 16.01.2012 15:27, schrieb Jesse Woo:
> Hi Guys,
>
> I have created a SNMP Agent based on org.snmp4j.agent.example. 
> SampleAgent.java.
>
> This agent is running as part of my system, and I want to completely exit the 
> agent before I can shut the whole system down.
>
> I tried shutdown() method from AgentConfigManager.java, and it did close the 
> session but seems it left the thread in memory.
>
> How can I exit the agent completely?
>
> Much appreciated for your help.
>
> Regards,
> Jesse
> _______________________________________________
> SNMP4J mailing list
> [email protected]
> http://lists.agentpp.org/mailman/listinfo/snmp4j

--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231

_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j
_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to