Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* @author Artem Bilan
* @author Christian Tzolov
* @author Ngoc Nhan
* @author Jooyoung Pyoung
*
* @since 2.0
*
Expand Down Expand Up @@ -85,8 +86,9 @@ protected void checkActive() {

@Override
protected TcpConnectionSupport buildNewConnection() {
SocketChannel socketChannel = null;
try {
SocketChannel socketChannel = SocketChannel.open();
socketChannel = SocketChannel.open();
setSocketAttributes(socketChannel.socket());
connect(socketChannel);
TcpNioConnection connection =
Expand All @@ -113,6 +115,14 @@ protected TcpConnectionSupport buildNewConnection() {
return wrappedConnection;
}
catch (IOException e) {
try {
if (socketChannel != null) {
socketChannel.close();
}
}
catch (IOException e2) {
logger.error(e2, "Error closing socket channel");
}
throw new UncheckedIOException(e);
}
catch (InterruptedException e) {
Expand Down
Loading