473,473 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

settings network timeouts in python

Hi All,

I have a problem here. I'm connecting to some pop server.Here i need to
set the network timeouts,since some times my program disconnecting from
net at tht point of time I'm unable to connect to POP server. Can any
one provide the solution for it.

code;

import poplib
m=poplib.POP3('pop.mail.yahoo.com',110)
m.user('XXX')
m.pass_('XXX')
# here i need to set the network time out when I'm connecting to POP
server. i.e in the line
m=poplib.POP3('pop.mail.yahoo.com')
Any help can be greatly appreciated

Thanks,
Narendra

Dec 19 '05 #1
2 1573
Narendra wrote:
Hi All,

I have a problem here. I'm connecting to some pop server.Here i need to
set the network timeouts,since some times my program disconnecting from
net at tht point of time I'm unable to connect to POP server. Can any
one provide the solution for it.

code;

import poplib
m=poplib.POP3('pop.mail.yahoo.com',110)
m.user('XXX')
m.pass_('XXX')
# here i need to set the network time out when I'm connecting to POP
server. i.e in the line
m=poplib.POP3('pop.mail.yahoo.com')
Any help can be greatly appreciated

Precede your code with

import socket
socket.setdefaulttimeout(60)

for a one-minute timeout.

Regarding your other problem, I don't know what will make a message be
classified as "bulk" by a particular receiving MTS, you'll have to ask
the operators of the mail server in question.

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/

Dec 19 '05 #2
Thanks Steve

Itz working. Thanks a lot!

Dec 19 '05 #3

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

Similar topics

3
by: Fazer | last post by:
Hello, I was wondering what's the best way of setting timeouts when working with urllib2. Thanks,
1
by: Robert | last post by:
I am trying to figure out how to change TCP/IP settings through VC# (IP Address, DNS, WINS, Gateway, Computer Name, Host, etc), but cannot find anything anywhere. I'm sure that it's out there, but...
6
by: harry | last post by:
Hi, I have a program that runs on multiple client pc's. Occasionally one or more of those pc's use VPN to connect to another corporate network. When using VPN they need to set proxy server in...
11
by: galina betz | last post by:
Please help! Getting this error intermittently: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not...
6
by: John Walton | last post by:
Hello, everyone. I just began school, and they already assigned us science fair. Since I'm in 8th grade, I get to do demonstrations for our projects. I'm probably going to demonstrate Python's...
0
by: John Nagle | last post by:
What actually works and what doesn't in socket timeouts in Python 2.5? What breaks with timeouts turned on? There are lots of patches and bug reports, but no coherent summary. John Nagle
0
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
4
by: Giampaolo Rodola' | last post by:
Hi, I'm trying to implement an asynchronous scheduler for asyncore to call functions at a later time without blocking the main loop. The logic behind it consists in: - adding the scheduled...
11
by: =?Utf-8?B?cGJjb2Rlcg==?= | last post by:
Hi, I have been asked to create a solution in a single exe - using C# .NET 3.5. I have found that I can us ILMerge to create a single exe of all of my Application assemblies. But my...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.