473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Resolving 10060, 'Operation timed out'

Does anyone know how to prevent this error from occurring: IOError:
[Errno socket error] (10060, 'Operation timed out').

I am using the following code without any luck. Obviously I am missing
something.

import socket
socket.setdefaulttimeout(20)

Thank you in advance.

Tom Williams

Jul 19 '05 #1
3 8150
My manual says that socket has a settimeout(value) but I don't
seem to find anything on socket.setdefaulttimeout method you
refer to.

<snip>
settimeout( value)

Set a timeout on blocking socket operations. The value argument can be a
nonnegative float expressing seconds, or None. If a float is given, subsequent
socket operations will raise an timeout exception if the timeout period value
has elapsed before the operation has completed. Setting a timeout of None
disables timeouts on socket operations. s.settimeout(0.0) is equivalent to
s.setblocking(0); s.settimeout(None) is equivalent to s.setblocking(1). New in
version 2.3.

-Larry Bates

willitfw wrote:
Does anyone know how to prevent this error from occurring: IOError:
[Errno socket error] (10060, 'Operation timed out').

I am using the following code without any luck. Obviously I am missing
something.

import socket
socket.setdefaulttimeout(20)

Thank you in advance.

Tom Williams

Jul 19 '05 #2
Larry Bates wrote:
My manual says that socket has a settimeout(value) but I don't
seem to find anything on socket.setdefaulttimeout method you
refer to.


Larry, the module has a setdefaulttimeout() function,
while socket objects themselves have a settimeout().

To the OP: did you already create your socket object
before you called setdefaulttimeout()? That setting
applies only to *new* sockets created after you call
the function...

-Peter
Jul 19 '05 #3
willitfw wrote:
I'm including the code that I've been using. I am relatively new to
python, and not sure if a socket was created:

*****************
import socket

socket.setdefaulttimeout(None)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)


The last line above creates a socket... and I suspect
the line ahead of it is redundant.

More importantly, you can probably avoid using
the defaulttimeout thing if you just do settimeout
on the newly created socket...
Jul 19 '05 #4

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

Similar topics

0
by: Ajay Abhyankar | last post by:
Hi, I am trying to upload zip files using ftplib module. The server has Vsftpd 2.0.3 installed on it. I was able to succesfully upload files using ftplib and Vsftpd on the server locally...
1
by: Joško Šugar | last post by:
I have a data transfer between an c# application and web service. The application is in local network and connects to the internet thru a gateway. Connection is ADSL. Web service is on the remote...
5
by: Sachin Surana | last post by:
We use HttpWebRequest to send the request at a URL. But some times the method GetResponse throws a time out exception. But when we check the IIS logs, there is no such entry. So the request never...
4
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
2
by: tlan | last post by:
Hi, I got this error when I move my web service to Windows2003 server. I spent hours scouting on the internet and could find any answer. Please help!!! I the webservice is timeout between 1...
11
by: Sumit Acharya | last post by:
I am using following script to connect to the server and i try the connection for 1000 times. Some times it succeeds for all the 1000 times,but some times it fails with error:- 10060, 'Operation...
3
by: JuHui | last post by:
I wrote a script to get 100 pages from a server. like below: 1:import httplib 2:conns = httplib.HTTPConnection("www.mytest.com") 3:conn.request("GET", "/") sometimes a socket error was...
10
by: Jim Underwood | last post by:
I am having a problem with my web page timng out while retrieving a long runnign report (90-120 seconds. I have tried modifying several settings in various places and cannot get it to run for more...
0
by: Jinshi | last post by:
Hello, everyone, I am quite new to python and I don't know how to solve this problem. I hope someone can help me. I just did a test in python shell: Traceback (most recent call last): File...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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
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
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,...

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.