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),
|
||||
Throwable::printStackTrace);
|
||||
|
||||
// TCP communnication tests
|
||||
// TCP communication tests
|
||||
connectionListener = new ConnectionListener();
|
||||
connectionListener.acceptConnection(user -> {
|
||||
}, e -> {
|
||||
connectionListener.acceptConnection(user -> System.out.println("New connection request : " + user.getUsername()), e -> {
|
||||
if (e instanceof java.io.EOFException) {
|
||||
System.out.println("Connexion terminée");
|
||||
} 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 !");
|
||||
user.destroy();
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue