Hello,

 It's certainly possible that Google's web servers impose some server-
side timeout on their connections, though I expect it's something
fairly high. (I'm afraid I don't know off the top of my head what it
is, and it's probably not something specific to the AdWords API but
rather our web infrastructure in general.) I don't think the correct
way of dealing with that is to "tickle" an active connection that is
waiting for a response with a new request in the hopes of preventing
the server from dropping the connection before it responds to the
original request. I also don't think that there is any provision in
the HTTP spec in general for using the same connection to send
multiple HTTP requests in parallel--unless I'm mistaken, HTTP keep-
alives refer to using the same connection for multiple requests one
after another in sequence.

 So anyway, the way to approach this problem is to first make sure
that the timeout isn't being triggered on the client side--I know you
say the specific error message points to the server, but just double-
check that. Assuming it's a server-side timeout, restructuring your
requests so that you request smaller chunks of data at a time would
make sense, or alternatively switching to using the ReportService to
retrieve the data you're looking for, would make sense to me.

 Also, and I'm kind of surprised I haven't seen any discussion of this
in this group yet, in 2009 we'll be rolling out a major new release of
the AdWords API. One of the features of this release will be support
for asynchronous method calls. In such a setup you wouldn't have to
keep your HTTP connection open waiting for the response from a large
request in the first place.

 More details on the changes in store for the AdWords API in 2009 is
available on the blog at

  
http://adwordsapi.blogspot.com/2008/12/preview-of-2009-adwords-api-changes.html

Cheers,
-Jeff Posnick, AdWords API Team


On Dec 19, 5:59 pm, crozzer <cro...@justanswer.com> wrote:
> I've got a long-running job (a few hours) that iterates through all of
> our 2.8 million criterion across 5 accounts in order to download
> them.  I intermittently run across an error like "the connections was
> expected to be kept open but was closed by the server..." (I can get
> the exact error next time it happens, if necessary).
>
> I'm hoping someone might suggest a good "keep alive" type request I
> could insert into my code to execute on occasion with the intent of
> keeping the connection alive.
>
> Also, if I try/catch an exception, could you suggest code for re-
> establishing a connection, rather just bailing out completely?
>
> We are on .NET 3.5 and sdwords api v13
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to 
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to