06-11-2019 09:07 PM
Hello,
I am interacting with the Segger RTT interface via TCP. Upon ESTABLISHING a connection, they spawn another LISTENER. I am able to indefinitely telnet to 127.0.0.1 19021 and create new connections:
0
C:\cmder λ netstat -an -p tcp | findstr 19021 TCP 127.0.0.1:19021 0.0.0.0:0 LISTENING
1 C:\cmder λ netstat -an -p tcp | findstr 19021 TCP 127.0.0.1:19021 0.0.0.0:0 LISTENING TCP 127.0.0.1:19021 127.0.0.1:60132 ESTABLISHED TCP 127.0.0.1:60132 127.0.0.1:19021 ESTABLISHED
2 C:\cmder λ netstat -an -p tcp | findstr 19021 TCP 127.0.0.1:19021 0.0.0.0:0 LISTENING TCP 127.0.0.1:19021 127.0.0.1:60132 ESTABLISHED TCP 127.0.0.1:19021 127.0.0.1:60155 ESTABLISHED TCP 127.0.0.1:60132 127.0.0.1:19021 ESTABLISHED TCP 127.0.0.1:60155 127.0.0.1:19021 ESTABLISHED
In the LabVIEW vi, TCP Open Connection only works in case `0` above, which is when no connections are ESTABLISHED. In cases 1 and 2, I get Error 63:
Error 63 occurred at TCP Open Connection in RTT TCP Client.vi
Possible reason(s):
LabVIEW: Serial port receive buffer overflow.
=========================
LabVIEW: The network connection was refused by the server.
How can I get LabVIEW TCP Open Connection to behave more like telnet and find the LISTENER?
Cheers,
Joe
06-11-2019 09:20 PM
Further testing shows that there is a maximum of two connections no matter what application attempts to connect. LabVIEW only works for the first connection.
06-11-2019 09:30 PM
Upon "Close TCP Connection" in LabVIEW it results in these states (CLOSE_WAIT and FIN_WAIT_2):
C:\cmder λ netstat -aon -p tcp | findstr 19021 TCP 127.0.0.1:19021 0.0.0.0:0 LISTENING 1656 TCP 127.0.0.1:19021 127.0.0.1:60938 CLOSE_WAIT 1656 TCP 127.0.0.1:19021 127.0.0.1:61013 ESTABLISHED 1656 TCP 127.0.0.1:60938 127.0.0.1:19021 FIN_WAIT_2 8148 TCP 127.0.0.1:61013 127.0.0.1:19021 ESTABLISHED 11860
Same occurs with Telnet. Not finishing closing the connection may be a Segger issue.