04-10-2013 09:42 PM
Hello
My task is to implement two-sided communication through tcp/ip.
It has to be asynchronous (two connections working independly) so I decided to create a server that uses two ports and the same to the client.
After looking at examples(simple data server,client), what I did was just copy while loop and configure the copyied loop to read bytes.
So one loop sends data, another receive- thats the server.vi. - I did the same to client. (there are two loops per VI,2 ports)
It seems to work fine, when I`m sending data INDEPENDLY f.g loop iterations, but
there is a problem when I try to:
1.send cluster from server to client (sending and reciving port )
2.After using some written stuff, to send cluster from client recieving loop to client sending loop (within one VI)
3.Send the same cluster back to server.vi
4. Send Cluster (it can be any variable actually) between server loops
5. Modyfy that variable (i.e of cluster) by incrementing it .
6. Doing things included in point 1.
I thought thats the way to obtain the highest speed connection, however the variable is modyfied in the very low speed, much lower than connections are establish. I thought that they matched to each other.
I attach an examples with only 1 variable (thought is clear). The example using clusters works very much slower
I appreciate any help !
With best Regards
Jakub
04-11-2013 12:46 PM
TCP is a bi-directional protocol so you should use a single connection. A single connection may also be faster due to the way the Nagle algorithm works (it is designed to minimize packet overhead by combining multiple small packets into a single larger transmission, and it works best on a single bidirectional link). It is not clear what you're trying to do here; it would be more helpful if you include the entire example with the clusters.
04-19-2013 08:27 AM
Hi Jakub!
If you're looking into maximising speed for TCP-IP, I encourage you to check out this thread. Lots of useful information.
Best regards:
Andrew Valko
NI Hungary