This is our old Q&A Site. Please post any new questions and answers at

I'm testing an application which downloads info from photovoltaic equipment, so I have to connect to a remote power plant via Internet, using a TCP connection, I download info with my application and then I disconnect... Sometimes when I try to reconnect with remote power plant after few minutes, I can't do it, so, looking for a clue I have started capturing packets with wireshark and I can see that sometimes I send [FIN, ACK] and I get [ACK], then I get [FIN,ACK] and I send [ACK] and everything is OK for next connection, but sometimes I send [FIN,ACK] and I get [RST] and then I have to wait about 5 minutes before I can reconnect with remote router........ Any idea?

asked 12 Sep '12, 09:56

pedrojpz's gravatar image

accept rate: 0%

It sounds like (from your description) that the photovoltaic equipment is getting stuck in some FINWAIT state. In other words, it's not gracefully handling the tcp tear down and when that happens, you have to wait for a timeout (some multiples of MSL). I'm not sure you'll be able to do anything since you probably can't touch the tcp stack.

permanent link

answered 12 Sep '12, 14:30

hansangb's gravatar image

accept rate: 12%

This is driving me crazy... Thanks for your reply.

(13 Sep '12, 00:50) pedrojpz

I'd try to capture as close as possible to the remote system to see if what you send gets there unmodified. That way you can also have an unbiased look at the exact stack behaviour of the photovoltaic system, and see if Hansang's idea seems plausible (in which case you'll have to kick the vendor of the thing to get it's stack done right). Industrial TCP stacks in embedded systems are a certifiable nightmare in my experience, the developers seem to stick to RFCs only as much as they absolutely have to to get the thing to work under perfect circumstances...

(13 Sep '12, 10:19) Jasper ♦♦

but sometimes I send [FIN,ACK] and I get [RST] and then I have to wait about 5 minutes before I can reconnect with remote router........ Any idea?

Just a wild idea...

sounds like the service that handles the TCP port crashes and then the OS sends a RST, as the local socket is no longer available. Then after 5 minutes some kind of 'watchdog' restarts the service and then you can reconnect.


permanent link

answered 13 Sep '12, 10:28

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
accept rate: 15%

I think you may be on to something. I didn't go into it, but I didn't like trace evidence as much to support the FINWAIT argument. I didn't want to get into it too deeply because, let's face it, what exactly can you do if the stack is bad? I think it'll come down to the fact that the stack is not handling exceptions correctly and starting the process.

(13 Sep '12, 10:49) hansangb
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 12 Sep '12, 09:56

question was seen: 8,162 times

last updated: 12 Jul '13, 02:10

p​o​w​e​r​e​d by O​S​Q​A