This commit is contained in:
Mongolila-098
2026-04-29 18:31:15 +02:00
3 changed files with 32 additions and 21 deletions

View File

@@ -214,7 +214,7 @@ public class DirectoryConnector {
}
public String getClientAddress() {
try {
/* try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
@@ -230,7 +230,16 @@ public class DirectoryConnector {
}
} catch (Exception e) { e.printStackTrace(); }
return null;
*/
// esta forma es una ruina
String ip = null;
try {
socket.connect(directoryAddress);
ip = socket.getLocalAddress().getHostAddress();
socket.disconnect();
} catch (Exception e) {}
return ip;
}
/**