Skip to content

Commit

Permalink
Default Port no updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
urvesh254 committed May 28, 2021
1 parent a963128 commit 0ce6305
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ private void getClientInfo() throws IOException {
clientName = clientInfo.readLine();
System.out.print("Server IPV4 Address : ");
HOST_NAME = clientInfo.readLine();
System.out.print("Port (Default 3333): ");
System.out.print("Port (Default 54321): ");
try {
PORT = Integer.parseInt(clientInfo.readLine());
} catch (NumberFormatException e) {
PORT = 3333;
PORT = 54321;
}

if (clientName.isEmpty() || HOST_NAME.isEmpty()) {
Expand Down
6 changes: 3 additions & 3 deletions Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public static void main(String arg[]) {
HOST_NAME = InetAddress.getLocalHost().getHostName();
HOST_ADDRESS = InetAddress.getLocalHost().getHostAddress();

System.out.print("Port For Server (Default 3333) : ");
System.out.print("Port For Server (Default 54321) : ");
try {
PORT = Integer.parseInt(reader.readLine());
} catch (NumberFormatException e) {
System.out.println("\nPort No. you enter is invalid.\nServer is started on default port no 3333.");
PORT = 3333;
System.out.println("\nPort No. you enter is invalid.\nServer is started on default port no 54321.");
PORT = 54321;
}

ss = new ServerSocket(PORT);
Expand Down

0 comments on commit 0ce6305

Please sign in to comment.