Skip to content

Commit 065cab6

Browse files
Refactor : 3rd Update TelnetCommand.java
1 parent 00938d3 commit 065cab6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/com/mycmd/commands/TelnetCommand.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ public void execute(String[] args, ShellContext context) throws IOException {
7676
} catch (IOException e) {
7777
System.out.println("Connection failed: " + e.getMessage());
7878
}
79+
80+
try {
81+
reader.join(1000); // wait up to 1 second for reader to finish
82+
} catch (InterruptedException e) {
83+
Thread.currentThread().interrupt();
84+
}
7985
}
8086

8187
@Override

0 commit comments

Comments
 (0)