création de l'exécutable

This commit is contained in:
Louis Farina 2021-02-13 16:19:19 +01:00
parent 018624b364
commit 170da9977d
3 changed files with 5 additions and 4 deletions

View file

@ -48,7 +48,7 @@ public class ClientWindow implements ActionListener {
{
username = JOptionPane.showInputDialog(chatWindow,
"Enter a username",
"POPUPOPOPUPUPOPOPUP",
"Login",
JOptionPane.PLAIN_MESSAGE);
connected = network.connect(username);

View file

@ -72,9 +72,9 @@ class ReceiveThread extends Thread {
boolean exit = false;
try
{
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
while(!exit)
{
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
Message message = (Message) in.readObject();
if(message.getText() != null)
{
@ -364,7 +364,9 @@ public class NetworkClient {
ServerSocket s1 = new ServerSocket(portNumber);
(new ListenerStartThread(s1, dest_sockets)).start();
Socket s2 = new Socket("25.67.234.235", portNumber);
Socket s2 = new Socket(getLocalIP(), portNumber);
/*Attention! getLocalIP ne marche que si les machines sont sur un même réseau local physique
Pour tester avec Hamachi, il faut hardcoder les IP*/
(new ReceiveThread(user, s2, chatText, known_users, knownUsersPanel, dest_sockets)).start();
}
catch(IOException e)

View file

@ -1 +0,0 @@
package chat;