Sha256: fa82b366c0173be6181727f4b3f9feeac3ab9b59ff705a792c32620b7ac8e93b

Contents?: true

Size: 312 Bytes

Versions: 6

Compression:

Stored size: 312 Bytes

Contents

class TCPServer
  def tcp_fast_open
    # macOS devices option is DIFFERENT from Linux and FreeBSD
    opt = (/darwin/ =~ RUBY_PLATFORM) ? 1 : 5
    # Magic number 6 may refer to Socket::SOL_TCP or Socket::IPPROTO_TCP
    self.setsockopt(6, Socket::TCP_FASTOPEN, opt)
    true
  rescue => _e
    false
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
midori.rb-0.6.0 lib/midori/core_ext/tcp_server.rb
midori.rb-0.5.4 lib/midori/core_ext/tcp_server.rb
midori.rb-0.5.3.1 lib/midori/core_ext/tcp_server.rb
midori.rb-0.5.3 lib/midori/core_ext/tcp_server.rb
midori.rb-0.5.2 lib/midori/core_ext/tcp_server.rb
midori.rb-0.5.1 lib/midori/core_ext/tcp_server.rb