Skip to content

Commit 890ea3a

Browse files
committed
Warn when SocketTimeout option is used
Motivation: The SocketTimeout option has been deprecated. Modification: Warns when socketTimeout option is used Result: Fix
1 parent 505bdd4 commit 890ea3a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/io/asyncer/r2dbc/mysql/client/Client.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import io.asyncer.r2dbc.mysql.message.server.ServerMessage;
2323
import io.netty.buffer.ByteBufAllocator;
2424
import io.netty.channel.ChannelOption;
25+
import io.netty.util.internal.logging.InternalLogger;
26+
import io.netty.util.internal.logging.InternalLoggerFactory;
2527
import org.jetbrains.annotations.Nullable;
2628
import reactor.core.publisher.Flux;
2729
import reactor.core.publisher.Mono;
@@ -39,6 +41,7 @@
3941
* An abstraction that wraps the networking part of exchanging methods.
4042
*/
4143
public interface Client {
44+
InternalLogger logger = InternalLoggerFactory.getInstance(Client.class);
4245

4346
/**
4447
* Perform an exchange of a request message. Calling this method while a previous exchange is active will
@@ -133,8 +136,7 @@ static Mono<Client> connect(MySqlSslConfiguration ssl, SocketAddress address, bo
133136
}
134137

135138
if (socketTimeout != null) {
136-
tcpClient = tcpClient.option(ChannelOption.SO_TIMEOUT,
137-
Math.toIntExact(socketTimeout.toMillis()));
139+
logger.warn("Socket timeout is not supported by the underlying connection and will be ignored.");
138140
}
139141

140142
if (address instanceof InetSocketAddress) {

0 commit comments

Comments
 (0)