473,698 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.setdefau lttimeout(20)

Thank you in advance.

Tom Williams

Jul 19 '05 #1
3 8213
My manual says that socket has a settimeout(valu e) but I don't
seem to find anything on socket.setdefau lttimeout 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(No ne) 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.setdefau lttimeout(20)

Thank you in advance.

Tom Williams

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


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

To the OP: did you already create your socket object
before you called setdefaulttimeo ut()? 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.setdefau lttimeout(None)
sock = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)


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
1729
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 connected. Now, I want to transfer files to remote server using the same script. I am getting the following error: Traceback (most recent call last): File "<pyshell#32>", line 1, in -toplevel-
1
8194
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 server. Timeuots are configured as follows: local timeout: <add key="WebService.Timeout" value="300000" /> remote timeout: <httpRuntime executionTimeout="300" maxRequestLength="10000"/>
5
9033
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 reached the server but the client is getting a time out exception. What could be the possible reasons? Confirmed that the request does not get lost in the network.
4
2931
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 'http://mydomain.com:port/webservice.asmx' The operation has timed-out (I've tried with and without using a separate port for the service) The weird thing is the page does show up on the left side of the screen listing the available methods but the Add...
2
25460
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 -2 minutes when my web app, which consume this webService, retrieves a large amount of data. When I perform the same operation to retrieve smaller amount of data, it works fine. The timeout value I set for my web app, web service, and sql
11
4364
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 timed out'. When it fails with the abover error, it seems timed out time is 20 seconds. Is there a way I can increase the timedout time for FTP? from ftplib import FTP import time import sys
3
16550
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 raised. File "D:\usr\bin\lib\httplib.py", line 627, in connect
10
19149
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 than 90 seconds. I am running VS.Net and the app is ASP.Net, written using VB.Net. The app calls an asp.Net web service to retrieve the report. Both the web site and the web service are running locally on my PC. I have tried modifying the...
0
2620
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 "c:\Zope\<string>", line 1, in ? File "C:\Zope\2.10.5\Python\Lib\urllib2.py", line 130, in urlopen
0
8676
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
9161
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...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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
8867
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...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
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

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.