Hi,

First of all, you are using a pretty old SNMP4J version, I recommend an upgrade.
The socket is closed most likely by the operating system. A reason could be
that it was not used for a longer time and the operating system reclaimed that socket.

More likely, the close() operation has been called on the transport object by some
other thread (or the same) because of some other network error.

Best regards,
Frank

Am 04.05.2016 um 05:12 schrieb linhui (F):
Hi,
In our code, we use Snmp Object to send a trap. The question is : while running 
for some time (may be a week) in Windows platform, there will occur exception 
while sending trap.

The Exception stack is :
          org.snmp4j.MessageException: Socket is closed
          at 
org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:485)
          at org.snmp4j.Snmp.sendMessage(Snmp.java:1082)
          at org.snmp4j.Snmp.send(Snmp.java:882)
          at org.snmp4j.Snmp.send(Snmp.java:875)
          ...

I have checked the source, The closed socket is DefaultUdpTransportMapping's 
DatagramSocket.

Another messages:

(1)     Before running the sending-trap thread, we use listen() function to 
listen the IP and port which is the same as sending-trap IP and port.
For example, the IP is 10.66.92.233 and port is 6666, we listen 
10.66.92.233/6666 and use 10.66.92.233/6666 to send a trap.


(2)     SNMP4j's version is 1.11.2


At the beginning of the thread running, there are no exceptions occur. And I 
don't know why this exception occur.

Somebody can help me and explains this?

Best regards,
Lin Hui
_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
https://oosnmp.net/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
SNMP4J@agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j

Reply via email to