mirror of
https://github.com/binlaab/nanofiles.git
synced 2026-07-01 13:37:22 +02:00
ni idea
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user