Browse Source

Allow activation of experimental socket backend for inet/gen_tcp

juhlig 4 years ago
parent
commit
38041e63ed
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/mysql_conn.erl

+ 5 - 0
src/mysql_conn.erl

@@ -168,6 +168,11 @@ connect_socket(#state{tcp_opts = TcpOpts, host = Host, port = Port} = State) ->
 
     {ok, State#state{socket = Socket}}.
 
+sanitize_tcp_opts([{inet_backend, _} = InetBackend | TcpOpts0]) ->
+    %% This option is be used to turn on the experimental socket backend for
+    %% gen_tcp/inet (OTP/23). If given, it must remain the first option in the
+    %% list.
+    [InetBackend | sanitize_tcp_opts(TcpOpts0)];
 sanitize_tcp_opts(TcpOpts0) ->
     TcpOpts1 = lists:filter(
         fun