LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Read Fail

Solved!
Go to solution

@LLindenbauer wrote:

The whole purpose is having a two-way communication, not hangig up the phone after every sentence.


While that is usually preferable it is not the only way to operate. HTTP was originally designed to open a new connection for every request. Most likely this was based on the fact that most applications were still written as single threaded apps in the early 90ies and to be able to serve multiple connections in parallel a server either needs to spawn a new process for each connection or do its own involved arbitration of the multiple connections if it can’t use multithreading. With a new connection for each request the arbitration is inherently handled at the cost of extra overhead as each new connection requires significant effort on the TCP/IP level for handshaking of establishing and destructing the connection. With a wired internal network as CERN had it, that was not that bad but when you had to do HTTP over a 19k2b dial up connection things got pretty bad.

 

So this device may indeed not only require a distinct socket connection for each direction but also force close the connection after each request. That’s definitely not efficient nor simple but a possible mode of operation.

Rolf Kalbermatter
My Blog
0 Kudos
Message 21 of 22
(335 Views)
Solution
Accepted by topic author Froboz

I just wanted to thank you guys for your support.  I do have it working now.  A socket is created before every command is made and then it is destroyed.  Same with Listen.  A socket is created, system listens for a while, and then that socket is closed.   That would explain why the delay helps in the case of Python, because the script has not had a chance to start listening before the response is sent out.   Not certain why it was programmed in this manner, but it is, what it is.  

Froboz_0-1661271978247.png

And in the same VI the listen part.  But I continue to listen.

Froboz_1-1661272070968.png

Oversimplified but basic mechanics work.   Intially, I had the Listen loop included in the outer while loop where the command was sent, and I was having the listen close within that outer loop, and then be recreated at the other end, but that was clearly causing conflicts between the two.  Once they were divorced from each other, in completely separate loops, it started working.  Thanks again for the assist

 

0 Kudos
Message 22 of 22
(284 Views)