![]() |
| |||
| I'm having an issue where my program hangs while doing socket.connect() for a couple minutes, then times out. I'm connecting to an apache2 process on the same machine via the Internet, for testing. This *doesn't* happen when I connect to localhost or use my LAN IP from a different computer. Does anyone know a general reason this might happen? Even better, a way to fix it? When looking at netstat, the socket is in the SYN_SENT state, like this: $netstat -a -tcp tcp 0 0 *:www *:* LISTEN 7635/apache2 tcp 0 1 bukzor:38234 75.61.84.249:www SYN_SENT 9139/python Doing a minimal amount of research, I found this in the netstat manual: The state SYN_SENT means that an application has made a request for a TCP session, but has not yet received the return SYN+ACK packet. Here's the server. If you browse to it, it documents the exported functions. This always serves up fine without issue or delay, even though it's the same code serving it. http://bukzor.hopto.org/modpython/xmlrpc.py Here's my test client that's hanging. Feel free to run it. Change 'verbose' to True to get more debugging info. Code:
Thanks, --Buck |
| |||
| On Sun, 13 Jul 2008 21:46:46 -0700 (PDT), bukzor <workitharder@gmail.com> wrote: >I'm having an issue where my program hangs while doing >socket.connect() for a couple minutes, then times out. I'm connecting >to an apache2 process on the same machine via the Internet, for >testing. This *doesn't* happen when I connect to localhost or use my >LAN IP from a different computer. > >Does anyone know a general reason this might happen? Even better, a >way to fix it? Your modem/router doesn't know it has to loopback requests to your LAN when you issue a request to your apache using your WAN address. Search this group for my name and "NAT loopback" for more details and solutions. -- ) Kees ( c[_] Age is not a particularly interesting subject. Anyone can get old. All you have to do is live long enough. -- Julius Henry "Groucho" Marx [#474] |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |