Hi Prema,
I have changed the initialization of the UdpAddress to
UdpAddress("0.0.0.0/0").
This however breaks the default constructor on IPv6 only systems.
I am currently thinking of deprecating the default constructor and
removing it
from the (future) 3.0 code.
Best regards,
Frank
Am 23.07.2014 14:59, schrieb Prema Upot:
Hi Frank,
In the default constructor,
public DefaultUdpTransportMapping() throws IOException {
super(new UdpAddress(InetAddress.getLocalHost(), 0));
socket = new DatagramSocket(udpAddress.getPort());
}
the UdpAddress is initialized with localhost as you mentioned. But only the
port is passed to DatagramSocket and thus the ip address it binds to is a wild
card ipaddress.
But in renewSocetAfterException(), Socket is initialized using both ip and port
which causes the mismatch.
DatagramSocket s = new DatagramSocket(udpAddress.getPort(),
udpAddress.getInetAddress());
Thanks,
Prema
-----Original Message-----
From: SNMP4J [mailto:[email protected]] On Behalf Of Frank Fock
Sent: Tuesday, July 22, 2014 4:57 PM
To: [email protected]
Subject: Re: [SNMP4J] renewSocketAfterException() binds to a specific address
Hi Prema,
The renewSocketAdterException(..) method of the DefaultUdpTransportMapping uses *exactly*
the same UDP address as provided in the constructor. If you provided "0.0.0.0",
it will be used again.
You wrote that you are using the default constructor. That one is *not* using
"0.0.0.0", instead it uses the localhost IP address. It depends on your
operating system and Java virtual machine which IP that is on a multi-home system.
Best regards,
Frank
Am 22.07.2014 20:18, schrieb Prema Upot:
Hi,
We initialize DefaultUdpTransportMapping using the default constructor and this makes
sure the listening port binds to "0.0.0.0" address enabling sending and
receiving UDP packets on any interface. But in renewSocketAfterException() the new socket
is created using port and ipaddress as parameters and this causes a problems in a PC that
is part of multiple networks.
For example, we have a PC in 192.168.144.0 and 192.168.30.0 networks. After socket exception, the new socket that is
created binds to "192.168.144.<ip>:<port>" instead of "0.0.0.0:<port>" and
because of this we cannot communicate with 30.0 network any more.
Thanks,
Prema
_______________________________________________
SNMP4J mailing list
[email protected]
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
[email protected]
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
[email protected]
https://oosnmp.net/mailman/listinfo/snmp4j