Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

keep-alive problems

#56

hi marc,

I can't get keep-alive to work in either 0.7 or HEAD. I'm doing something simple like this:
app = SimpleApp.new server = Thin::Server.new('0.0.0.0', 4001, app) server.start!

Perhaps I'm missing some config option?

When I put 'return true' into Request#persistent and Response#persistent, I get responses with
Connection: Keep-Alive
but without Content-Length headers (required for persistent requests - otherwise the client doesn't know when the last response ended).

ry

Reported by ry · March 23rd, 2008 @ 08:20 PM

State: invalid
Milestone: 0.8.0
Assigned to: macournoyer macournoyer

Activity

  1. macournoyer
    macournoyer
    • Milestone set to 0.8.0
    • State changed from new to open

    Hey Ry,

    Keep alive is the default behaviour in HTTP 1.1 unless Connection: close is specified. Your application must set Content-Length 'cause some browsers were hanging w/ keep-alive and NO content-length.

    Here's a quick piece of code that use a persistent connection to make 2 requests:

    require 'socket'
    
    socket = TCPSocket.new('0.0.0.0', 3000)
    
    2.times do
      socket.write "GET / HTTP/1.1\r\n\r\n"
      puts socket.readpartial(1024)
    end
    
    socket.close
    

    You can check the specs for persistent connections @ http://github.com/macournoyer/th...

    If you think there's a bug, are you able to reproduce w/ some code?

    March 23rd, 2008 @ 08:55 PM

  2. macournoyer
    macournoyer
    • State changed from open to invalid

    March 23rd, 2008 @ 09:50 PM

  3. John
    John
    • Tag set to keep-alive

    Per quanto ne so, i casinò online possono essere sia positivi che negativi per il tuo portafoglio. Se non vuoi sprecare il tuo tempo in ricerche inutili, visita il casinò Ice Casino e prendi i tuoi bonus. Se vuoi lasciare il tuo lavoro e guadagnarti da vivere giocando a un casinò, è la scelta https://ice-casino-play.com/lt/ migliore!

    June 13th, 2024 @ 09:51 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.