Use external IP not internal

This commit is contained in:
Manfred Karrer 2014-11-14 03:01:36 +01:00
parent 745cba983d
commit c8ece38889
4 changed files with 10 additions and 9 deletions

View file

@ -39,19 +39,19 @@
</GridPane.margin>
</Label>
<TextField fx:id="bitcoinNetwork" GridPane.rowIndex="0" GridPane.columnIndex="1"
mouseTransparent="true" editable="false" focusTraversable="false">
<GridPane.margin>
mouseTransparent="true" focusTraversable="false">
<GridPane.margin>
<Insets top="10"/>
</GridPane.margin>
</TextField>
<Label text="P2P network connection:" GridPane.rowIndex="1"/>
<TextField fx:id="connectionType" GridPane.rowIndex="1" GridPane.columnIndex="1"
mouseTransparent="true" editable="false" focusTraversable="false"/>
mouseTransparent="true" focusTraversable="false"/>
<Label text="My external visible P2P network address:" GridPane.rowIndex="2"/>
<TextField fx:id="nodeAddress" GridPane.rowIndex="2" GridPane.columnIndex="1"
mouseTransparent="true" editable="false" focusTraversable="false"/>
mouseTransparent="true" focusTraversable="false"/>
<Label text="P2P bootstrap node address:" GridPane.rowIndex="3">
<GridPane.margin>
@ -59,8 +59,8 @@
</GridPane.margin>
</Label>
<TextField fx:id="bootstrapNodeAddress" GridPane.rowIndex="3" GridPane.columnIndex="1"
mouseTransparent="true" editable="false" focusTraversable="false">
<GridPane.margin>
mouseTransparent="true" focusTraversable="false">
<GridPane.margin>
<Insets bottom="-15"/>
</GridPane.margin>
</TextField>

View file

@ -46,9 +46,9 @@ public class NetworkPreferencesViewCB implements Initializable {
@Override
public void initialize(URL url, ResourceBundle rb) {
bitcoinNetwork.setText(bitcoinNetworkValue);
connectionType.setText(clientNode.getConnectionType().toString());
nodeAddress.setText(clientNode.getAddress().toString());
bootstrapNodeAddress.setText(clientNode.getBootstrapNodeAddress().toString());
connectionType.setText(clientNode.getConnectionType().toString());
}
}

View file

@ -394,7 +394,7 @@ public class TomP2PNode implements ClientNode {
PeerSocketAddress socketAddress = peerDHT.peerAddress().peerSocketAddress();
return Node.at(
peerDHT.peerID().toString(),
socketAddress.inetAddress().getHostAddress(),
socketAddress.inetAddress().toString(),
socketAddress.tcpPort());
}

View file

@ -478,11 +478,12 @@ public class TomP2PTests {
// The sendDirect operation fails in port forwarding mode because most routers does not support NAT reflections.
// So if both clients are behind NAT they cannot send direct message to each other.
// Seems that in relay mode that is also not working
// That will probably be fixed in a future version of TomP2P
@Test
@Repeat(STRESS_TEST_COUNT)
public void testSendDirectBetweenLocalPeers() throws Exception {
if (FORCED_CONNECTION_TYPE != ConnectionType.NAT && resolvedConnectionType != ConnectionType.RELAY) {
if (FORCED_CONNECTION_TYPE == ConnectionType.DIRECT || resolvedConnectionType == ConnectionType.DIRECT) {
peer1DHT = getDHTPeer(client1Port);
peer2DHT = getDHTPeer(client2Port);