Skip to content

Commit

Permalink
Update ClientGUI.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedi6431 authored Jul 14, 2024
1 parent 8617374 commit 3354802
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ClientGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public void actionPerformed(ActionEvent e) {
try {
ServerControlPanel(address, port);
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "Unable to connect to server", "Server login panel", JOptionPane.ERROR_MESSAGE);
System.exit(1);
throw new RuntimeException(ex);
}
}
Expand Down Expand Up @@ -123,13 +125,12 @@ public static void ServerControlPanel(String address, int port) throws IOExcepti

// establish a connection with the server
Socket socket = new Socket(address, port);
JOptionPane.showMessageDialog(null, "Connected successfully to the server", "Server login panel", JOptionPane.INFORMATION_MESSAGE);

// IP of the server and the client
String serverIP = socket.getLocalAddress().getHostAddress();
String clientIP = Inet4Address.getLocalHost().getHostAddress();

JOptionPane.showMessageDialog(null, "Connected successfully to the server", "Server login panel", JOptionPane.INFORMATION_MESSAGE);

// get input from the terminal
BufferedReader ServerInfoOutput = new BufferedReader(new InputStreamReader(socket.getInputStream()));

Expand Down

0 comments on commit 3354802

Please sign in to comment.