Browse Source

Enable TCP option 'nodelay'

This makes sure small TCP packets are sent directly (#127)
Michael Lenaghan 6 years ago
parent
commit
ebe973ff8e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/mysql_conn.erl

+ 2 - 1
src/mysql_conn.erl

@@ -89,7 +89,8 @@ init(Opts) ->
     end,
 
     %% Connect socket
-    SockOpts = [binary, {packet, raw}, {active, false} | TcpOpts],
+    SockOpts = [binary, {packet, raw}, {active, false}, {nodelay, true}
+                | TcpOpts],
     {ok, Socket0} = SockMod0:connect(Host, Port, SockOpts),
 
     %% If buffer wasn't specifically defined make it at least as