Garayed.com  

Go Back   Garayed.com > Apache Configurations
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-2008, 05:46 AM
bukzor
 
Posts: n/a
Default connection hangs in SYN_SENT state.

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:
#!/usr/bin/env python from xmlrpclib import ServerProxy s = ServerProxy("http://bukzor.hopto.org/modpython/xmlrpc.py", verbose=False) i = 0 while True: i = s.add(i, 1) print i, s.helloworld()

Thanks,
--Buck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-14-2008, 08:48 PM
Kees Nuyt
 
Posts: n/a
Default Re: connection hangs in SYN_SENT state.

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]

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:37 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.