feat: print newly connected user
This commit is contained in:
parent
6ef37e2d72
commit
272ccd2914
1 changed files with 3 additions and 4 deletions
|
|
@ -48,10 +48,9 @@ public class MainApp extends Application {
|
||||||
(ipAddr, data) -> System.out.println("User detected at address : " + ipAddr.toString() + " with name " + data),
|
(ipAddr, data) -> System.out.println("User detected at address : " + ipAddr.toString() + " with name " + data),
|
||||||
Throwable::printStackTrace);
|
Throwable::printStackTrace);
|
||||||
|
|
||||||
// TCP communnication tests
|
// TCP communication tests
|
||||||
connectionListener = new ConnectionListener();
|
connectionListener = new ConnectionListener();
|
||||||
connectionListener.acceptConnection(user -> {
|
connectionListener.acceptConnection(user -> System.out.println("New connection request : " + user.getUsername()), e -> {
|
||||||
}, e -> {
|
|
||||||
if (e instanceof java.io.EOFException) {
|
if (e instanceof java.io.EOFException) {
|
||||||
System.out.println("Connexion terminée");
|
System.out.println("Connexion terminée");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -59,7 +58,7 @@ public class MainApp extends Application {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ActiveUser.create(InetAddress.getLocalHost(), user -> {
|
ActiveUser.create(InetAddress.getByName("192.168.43.14"), user -> {
|
||||||
System.out.println("Connexion établie !");
|
System.out.println("Connexion établie !");
|
||||||
user.destroy();
|
user.destroy();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue