mirror of
https://gitlab.com/Monsterovich/lanemu.git
synced 2024-07-14 09:31:16 +02:00
Fixed bug: upnp status sometimes not updated
This commit is contained in:
parent
a2afb3cab6
commit
b87208883e
|
@ -105,7 +105,7 @@ public class InfoWindow extends javax.swing.JFrame implements RoutungTableListen
|
||||||
"ID: " + connectionManager.getLocalAddr() +
|
"ID: " + connectionManager.getLocalAddr() +
|
||||||
" Port: " + connectionManager.getServerPort());
|
" Port: " + connectionManager.getServerPort());
|
||||||
connectionManager.getRouter().addTableListener(InfoWindow.this);
|
connectionManager.getRouter().addTableListener(InfoWindow.this);
|
||||||
connectionManager.getUPnPPortForward().addListener(InfoWindow.this);
|
connectionManager.getUPnPPortForward().addListener(InfoWindow.this, true);
|
||||||
}
|
}
|
||||||
peerGraph.setConnectionManager(connectionManager);
|
peerGraph.setConnectionManager(connectionManager);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,10 +120,14 @@ public class UPnPPortForward {
|
||||||
* Set the object of the upperlayer.
|
* Set the object of the upperlayer.
|
||||||
*
|
*
|
||||||
* @param l the upper layer
|
* @param l the upper layer
|
||||||
|
* @param refresh update the listener after adding
|
||||||
*/
|
*/
|
||||||
public void addListener(UPnPPortForwardListener l) {
|
public void addListener(UPnPPortForwardListener l, boolean refresh) {
|
||||||
synchronized (listeners) {
|
synchronized (listeners) {
|
||||||
listeners.add(l);
|
listeners.add(l);
|
||||||
|
if (refresh) {
|
||||||
|
l.upnpChanged(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue