Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm migrating a client / server application from Linux to Windows and while the Linux version of the server works fine, the Windows version won't connect via localhost. While the program is trying to negotiate the connection I see the following from netstat -a (irrelevant lines omitted).

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:9000           mgibson-dev:0          LISTENING
  TCP    0.0.0.0:9002           mgibson-dev:0          LISTENING
  TCP    127.0.0.1:9001         mgibson-dev:0          LISTENING
  TCP    [::1]:52403            mgibson-dev:9001       SYN_SENT
  TCP    [::1]:52404            mgibson-dev:9001       SYN_SENT

It seems that the server is trying to respond over IPv6. Is this normal and should it work? Am I looking at the problem or just a red herring?

share|improve this question
    
Is mgibson-dev local or remote? Can you run nestat -an or netstat -an -p tcp? –  Gerald Combs Feb 9 '11 at 20:12
add comment

2 Answers

up vote 0 down vote accepted
TCP    [::1]:52404            mgibson-dev:9001       SYN_SENT

This line seems to imply that you've tried to initiate an ipv6 connection to 'mgibson-dev' on port 9001. The SYN_SENT bit means that you've fired off a TCP SYN packet but not heard a response back.

If you're not listening on an ipv6 localhost address on TCP 9001, my initial guess would be that you have a firewall somewhere that's dropping the return packet somewhere. Normally, if the port's closed, you would expect a RST packet back, and then it would know the port isn't open and would try the ipv4 address. Because the RST packet's not coming through, it just hangs waiting for a response and eventually will time out.

In short, check your firewall to allow all inbound from localhost on both ipv4 and ipv6.

share|improve this answer
    
I was trying to connect to localhost, which was resolving to the ipv6 address I guess. Changing to 127.0.0.1 fixed it. The server was binding only to 127.0.0.1, not the ipv6 address. –  Mike Feb 9 '11 at 22:02
add comment

Well, the server was not trying to respond, SYN_SENT was a connection initiation state, so it was a client. It looks like the client was unable to get anything back from the mgibson-dev host. Are you sure mgibson-dev resolves to 127.0.0.1? Your server app is listening on 127.0.0.1 only and probably mgibson-dev resolves to any other address, this can be a root of your problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.