[twitter-dev] Re: Is it okay to close a connection by opening a new one?
> Why can't you do this entirely in your code? Why do you > need to close the connection and reconnect? My software keeps the local data file open as long as the connection is open, so the connection must be closed before the file can be moved or deleted. > Closing a file, moving it, and then creating a new file > should be able to be done extremely fast ... I know, but these cannot be done while the connection is open, thus the need to close it. And since a new connection will need to be opened almost immediately anyways, the natural way for me to close it is to open a new one. > JSON is a much better format to use. Not for me it isn't. My software has built-in XML parsing capabilities but it doesn't know how to deal with JSON data so XML is clearly the best way for me to go. Owkaye
[twitter-dev] Re: Is it okay to close a connection by opening a new one?
> > The Streaming API docs say we should avoid opening new > > connections with the same user:pass when that user > > already has a connection open. But I'm hoping it is > > okay to do this every hour or so ... > If you're only doing this every hour, that's fine by us. Great, thanks for the confirmation Alex! :)
[twitter-dev] Re: Is it okay to close a connection by opening a new one?
Hi, You can take some hint from here - http://hasin.wordpress.com/2009/06/20/collecting-data-from-streaming-api-in-twitter/ Avinash On Wed, Jul 15, 2009 at 4:43 AM, Joel Strellner wrote: > Why can’t you do this entirely in your code? Why do you need to close > the connection and reconnect? > > > > Closing a file, moving it, and then creating a new file should be able to > be done extremely fast, thus you shouldn’t need to close your connection to > Twitter. > > > > Also, if at all possible, JSON is a much better format to use. It’s > smaller over the wire, and it’ll create smaller files. > > > > -Joel > > > > > > *From:* twitter-development-talk@googlegroups.com [mailto: > twitter-development-t...@googlegroups.com] *On Behalf Of *Alex Payne > *Sent:* Tuesday, July 14, 2009 4:07 PM > *To:* twitter-development-talk@googlegroups.com > *Subject:* [twitter-dev] Re: Is it okay to close a connection by opening a > new one? > > > > If you're only doing this every hour, that's fine by us. > > On Tue, Jul 14, 2009 at 15:58, owkaye wrote: > > > The Streaming API docs say we should avoid opening new > connections with the same user:pass when that user already > has a connection open. But I'm hoping it is okay to do this > every hour or so, here's why: > > My plan is to write the streaming XML data to a text file > during each connection -- but I don't want this file to get > so big that I have trouble processing it on the back end. > Therefore I want to rotate these files every hour ... > > This means I have to stop writing to the file, close it, move > it somewhere else, and create a new file so I can use the new > file to continue storing new streaming XML data. > > The obvious way for me to close these files is to close the > connection -- by opening a new connection -- because from > what I've read it seems that opening a new connection forces > the previous connection to close. > > Can I do this without running into any black listing or > denial of service issues? I mean, is this an acceptable way > to close a connection ... by opening a new one in order to > force the old connection to close? > > Any info you can provide that will clarify this issue is > greatly appreciated, thanks! > > Owkaye > > > > > > > > -- > Alex Payne - Platform Lead, Twitter, Inc. > http://twitter.com/al3x >
[twitter-dev] Re: Is it okay to close a connection by opening a new one?
Why can't you do this entirely in your code? Why do you need to close the connection and reconnect? Closing a file, moving it, and then creating a new file should be able to be done extremely fast, thus you shouldn't need to close your connection to Twitter. Also, if at all possible, JSON is a much better format to use. It's smaller over the wire, and it'll create smaller files. -Joel From: twitter-development-talk@googlegroups.com [mailto:twitter-development-t...@googlegroups.com] On Behalf Of Alex Payne Sent: Tuesday, July 14, 2009 4:07 PM To: twitter-development-talk@googlegroups.com Subject: [twitter-dev] Re: Is it okay to close a connection by opening a new one? If you're only doing this every hour, that's fine by us. On Tue, Jul 14, 2009 at 15:58, owkaye wrote: The Streaming API docs say we should avoid opening new connections with the same user:pass when that user already has a connection open. But I'm hoping it is okay to do this every hour or so, here's why: My plan is to write the streaming XML data to a text file during each connection -- but I don't want this file to get so big that I have trouble processing it on the back end. Therefore I want to rotate these files every hour ... This means I have to stop writing to the file, close it, move it somewhere else, and create a new file so I can use the new file to continue storing new streaming XML data. The obvious way for me to close these files is to close the connection -- by opening a new connection -- because from what I've read it seems that opening a new connection forces the previous connection to close. Can I do this without running into any black listing or denial of service issues? I mean, is this an acceptable way to close a connection ... by opening a new one in order to force the old connection to close? Any info you can provide that will clarify this issue is greatly appreciated, thanks! Owkaye -- Alex Payne - Platform Lead, Twitter, Inc. http://twitter.com/al3x
[twitter-dev] Re: Is it okay to close a connection by opening a new one?
If you're only doing this every hour, that's fine by us. On Tue, Jul 14, 2009 at 15:58, owkaye wrote: > > The Streaming API docs say we should avoid opening new > connections with the same user:pass when that user already > has a connection open. But I'm hoping it is okay to do this > every hour or so, here's why: > > My plan is to write the streaming XML data to a text file > during each connection -- but I don't want this file to get > so big that I have trouble processing it on the back end. > Therefore I want to rotate these files every hour ... > > This means I have to stop writing to the file, close it, move > it somewhere else, and create a new file so I can use the new > file to continue storing new streaming XML data. > > The obvious way for me to close these files is to close the > connection -- by opening a new connection -- because from > what I've read it seems that opening a new connection forces > the previous connection to close. > > Can I do this without running into any black listing or > denial of service issues? I mean, is this an acceptable way > to close a connection ... by opening a new one in order to > force the old connection to close? > > Any info you can provide that will clarify this issue is > greatly appreciated, thanks! > > Owkaye > > > > > > -- Alex Payne - Platform Lead, Twitter, Inc. http://twitter.com/al3x