Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Added close on the channel after a port failure #276
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichailidis authored Jan 21, 2022
1 parent 6ff4e5c commit fa6b152
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ protected boolean isConnected() throws IOException {
return myChannel.read(byteBuffer) >= 0;
} catch (PortUnreachableException e) {
errorReporter.reportError("Port " + getHost() + ":" + getPort() + " not reachable", e);
Closer.close(channel());
} catch (IOException e) {
errorReporter.reportError("Cannot verify whether channel to " + getHost() + ":" + getPort() + " is connected: "
+ e.getMessage(), e);
Expand Down

0 comments on commit fa6b152

Please sign in to comment.