I was looking at Gist's Java code the other day
(http://gistinc.github.com/TwitterClient/) and they had a similar
coding - they were
seeing newlines every 30 seconds so they set the timeout to one

            // HttpClient has no way to set SO_KEEPALIVE on our
            // socket, and even if it did the TCP keepalive interval
            // may be too long, so we need to set a timeout at this
            // level.  Twitter will send periodic newlines for
            // keepalive if there is no traffic, but they don't say
            // how often.  Looking at the stream, it's every 30
            // seconds, so we use a read timeout of twice that.

M. Edward (Ed) Borasky

"A mathematician is a device for turning coffee into theorems." ~ Paul

On Feb 20, 8:45 pm, Marc Mims <marc.m...@gmail.com> wrote:
> * John Kalucki <j...@twitter.com> [100220 20:24]:
> > A 45 second period of inactivity is not unusual when following just 100, or
> > even 100,000 users. The keep-alive newlines are only sent once every 10
> > minutes. You should not reconnect so aggressively.
> I can certainly set the time out to 10 minutes.  I'm seeing newlines in
> the stream every 30 seconds, except for rare occasions. I understood
> those to be keep-alive packets.  Apparently they are not and should not
> be relied on?
> @semifor

Reply via email to