From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to close TCP port in LV 4.1?

I didn't write it...just trying to fix it. 😉
0 Kudos
Message 11 of 15
(441 Views)
Then review all of the code and start enclosing code inside single frame seq structures. Make sure data flow dicates order.

Of particular concern is WHEN the stop global is written. Make sure it does not get read to early!

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 15
(441 Views)
"I didn't write it...just trying to fix it. ;)"

That is exactly what I say when someone wonders into my office while I am looking at a customers code!

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 15
(441 Views)
Okay, attached is a vi I used to test with outside of the main application. I'm seeing the same problem (listening port never gets closed) with this.
This is a quick&dirty cut&paste mess of a vi, but hopefully you can make sense of what is going on. 😉
Panel:
Connect to server button: this will connect to the listening port. You should see "server socket", "remote address", "status" and "connection established" get filled out.
Listen Method switch: 1 (False) will execute the original server connection code using "TCP Listen". 2 (true) will execute the other method of doing a "create listener" and "wait on listener".
Stop App: stops the application.
Stop Listen: Trie
s to close the listener. This was added for a test. It returns an error as it thinks the listener is always closed.

This VI has been saved in LabView 6.1. I see the same problem I see in 4.1. No matter what I do, a netstat -a will always show a listener for port 10001.

Thanks again,
Kevin
0 Kudos
Message 14 of 15
(441 Views)
Sorry about the delay, I have a real job keeping me busy lately.

I played with this a bit and was able to reproduce something similar using the NI shipping examples.

I was able to correct it by;

1) Make sure you wire a timeout value! The default is about 10 minutes so you will have to wait that long to all evidence of the conncetion go away.

2) The client should close the conncetion b4 the host. This will leave a session hanging for 10 minutes as well.

Now that you have the ability to post as LV 6, I suggest you start a new question to get a wider audience. I am going to be very scarse in these parts over the next month or two.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 15
(441 Views)