Hi,

A Socketclosed exception can IMHO only occur, if the
socket was closed. Please check your code if the
main thread (or some other thread) closes the socket,
or if an uncaught exception occurs somewhere.

The code snippet below does not provide that
information.

Best regards,
Frank

On 22.09.2010 23:33, Garry Gerossie wrote:
> Hello,
>
> I have just started using SNMP4J and am experiencing a strange issue with
> it. I have a class called SnmpSession that looks like this
>
> public class SnmpSession
> {
>      private Snmp snmp = null;
>      private DefaultUdpTransportMapping udpTransport = null;
>
>      public SnmpSession()
>      {
>          try
>          {
>              udpTransport = new DefaultUdpTransportMapping();
>              udpTransport.listen();
>          }
>          catch( IOException e )
>          {
>              e.printStackTrace();
>          }
>
>          snmp = new Snmp( udpTransport );
>      }
> }
>
>
> Along with some send methods that send data using the snmp object. I am
> trying to use the TableUtils class to read the table asynchronously. In my
> TableListener class I am checking the TableEvent for Exception and I am
> frequently getting a MessageException with the detailed message
> "Socket is closed". I am not explicitly calling close on either the
> TransportMapping or the Snmp objects. I also do not think the socket is
> being closed due to garbage collection because this only happens when
> request volume is high. At low request volumes everything works fine. When I
> am trying to read lots of tables from lots of different devices I see this
> problem every time. Also, in my TableListener class the error is seen in the
> finished() method, not the next() method. I've tried to spread the load
> across multiple Snmp objects and also increased the buffer size of the UDP
> socket. Neither approach had much effect, the problem still occurs.
>
> Any thoughts or advice on fixing or working around this problem would be
> greatly appreciated.
>
> Cheers,
> -Garry Gerossie
> _______________________________________________
> SNMP4J mailing list
> SNMP4J@agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com

_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to