Skip to content

Instantly share code, notes, and snippets.

@headius

headius/.diff Secret

Last active November 12, 2019 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/79b162ab6f72aa038cb365d0a91ac68f to your computer and use it in GitHub Desktop.
Save headius/79b162ab6f72aa038cb365d0a91ac68f to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java b/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java
index ad2c7c60e9..17fd2bba3b 100644
--- a/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java
+++ b/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java
@@ -39,6 +39,7 @@ import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
+import jdk.net.ExtendedSocketOptions;
import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyFixnum;
@@ -164,6 +165,7 @@ public class RubyTCPServer extends RubyTCPSocket {
SocketChannel connected = getServerSocketChannel().accept();
if (connected == null) continue;
+ connected.setOption(ExtendedSocketOptions.TCP_QUICKACK, true);
connected.finishConnect();
// Force the client socket to be blocking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment