473,795 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP Keep-Alive with urllib2

Someone once asked about this an got no answer:

http://groups.google.dk/group/comp.l...11efce3b1776cf

Maybe I am luckier :)

Does anyone know how to do Keep-Alive with urllib2, that is, how to get
a persistent HTTP connection, instead of a new connection being opened
for every request?

/David
Nov 22 '05 #1
2 7296
David Rasmussen wrote:
Someone once asked about this an got no answer:

http://groups.google.dk/group/comp.l...11efce3b1776cf

Maybe I am luckier :)

Does anyone know how to do Keep-Alive with urllib2, that is, how to get
a persistent HTTP connection, instead of a new connection being opened
for every request?


This would imply the answer is "it's not possible":

sholden@bigboy ~/Projects/pycon
$ grep -i keep-alive /lib/python2.4/urllib*.py

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 22 '05 #2
David Rasmussen wrote:
Someone once asked about this an got no answer:

http://groups.google.dk/group/comp.l...11efce3b1776cf

Maybe I am luckier :)

Does anyone know how to do Keep-Alive with urllib2, that is, how to get
a persistent HTTP connection, instead of a new connection being opened
for every request?


This would imply the answer is "it's not possible":

sholden@bigboy ~/Projects/pycon
$ grep -i keep-alive /lib/python2.4/urllib*.py

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1431
by: Ron | last post by:
Hello, I keep getting a runtime error with the following ado routine that I run from a VB6 app - note: I tried it with ref to mdac2.6 and mdac2.7 and mdac2.8. This worked once, but it doesn't work anymore. I think I changed something, either in the code or on the system. It crashes at rs.Open... mylocattest.txt is a simple text file with one line of
6
2426
by: Drew | last post by:
I have been trying to figure out why I am getting this message... I have an application that is 20 different ASP pages that works in sequential order (step1, step2, step3...). After each step the app writes the entered text to a cookie. This feature is so that if there is a problem, we can still retrieve the data. This Bad Request error has something to do with the cookie that is written to, because I can go all the way through the app...
6
8643
by: Steve Jorgensen | last post by:
I tried to fix a problem for a client today in which report sections and even individual text controls in some of their reports are being split across page boundaries. Of course, I was thinking the answer was just going to be setting some Keep Together properties to Yes. Alas, it was not to be. It turns out that the report in question is actually a combination of 2 other reports based on different tables. The reports should follow one...
6
2515
by: Microsoft News | last post by:
Hi, I have been using several http server code examples from the web, include one from msdn, and I can't seem to get a simple http server thread working. I can connect the server successful using IE6 and following url: http://127.0.0.1:5050 But when I attempt a second connect the windows symbol in the upper right corner of ie starts in motion and nothing happens it just sits there waiting for a response. The code also behaves very...
0
1689
by: Mike Hoorens | last post by:
Hi there. This looks like a good place to get help with a problem I am having: - We have a c# windows app, which performs an HTTPWebRequest to a IIS box on Internet to retrieve an XML response. - In our test + develop environment this works wonderfully. We have it working through ISA server and also without ISA server. - At our client site however, the application times out. This appears to be caused by Keep Alives.
3
1192
by: Rajiv Das | last post by:
C# 2.0 XP SP2 In My Code, I am using HttpWebRequest to visit a particular URL. I am required to generate a snapshot image (if this request were made through say IE) and save as jpeg. About .1 million such requests are made in a cycle. What's the possible solution ?
1
1798
by: Mark Rae | last post by:
Hi, Development machine is: AMD dual-core 64-bit Athlon 4Gb RAM 2 x 160Gb SATA hard drives WinXP Pro + SP2 and all the latest patches Visual Studio.NET 2005 SQL Server 2005 developer edition
15
6724
by: l3vi | last post by:
I have a new system Im building that stores entries of what people are searching for on my sites. I want to be able to keep records of how many times a keyword was searched for daily, and from that I can calculate weekly and monthly. At this point I have one entry per search phrase with the number of hits the search phrase has gotten, and the last time it was updated. As I start to take the program out of testing and move in more...
11
9309
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1, y1, x2, y2); }
0
1774
by: db2admin | last post by:
hello, we take full on sunday and incremental delta rest of the days everyday. i want to keep only 8 weeks of backups on TSM. i am trying to understand the meaning of parameter "keep" in db2adutl command. if you say keep 64 which means 64 backups, will it try to keep 64 of full and 64 of incremental delta's ? if that is true, it will keep 64 weeks of full backups ( because we only take full backup once a week ) and keep
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.