LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does Datasocket us UDP or TCP packets?

Just need to know if the "lossy" mechanism used by Datasocket is UDP packets (which aren't garanteed to get there) or if the "lossy" mechanism is the possibility of new data overwriting older data (i.e. non-buffered) using TCP packets (which are garanteed to get there).
0 Kudos
Message 1 of 5
(3,177 Views)
> Just need to know if the "lossy" mechanism used by Datasocket is UDP
> packets (which aren't garanteed to get there) or if the "lossy"
> mechanism is the possibility of new data overwriting older data (i.e.
> non-buffered) using TCP packets (which are garanteed to get there).
>

Your questions are independent, I think. First off, datasocket doesn't
currently buffer values. Even if no packets were ever lost, reading
from a datasocket returns its current value. No queuing takes place,
and there may have been intermediate values arriving that you did not read.

And to answer the original question, I believe that it uses UDP.

Greg McKaskle
0 Kudos
Message 2 of 5
(3,177 Views)
How confident is your belief in it being UDP? I would just run a little experiment with two computers and netstat, but alas I am not in my usual enviornment and dont have that luxery (business trip).
0 Kudos
Message 3 of 5
(3,177 Views)
> How confident is your belief in it being UDP? I would just run a
> little experiment with two computers and netstat, but alas I am not in
> my usual enviornment and dont have that luxery (business trip).
>


Actually, I wasn't that confident, and was in fact wrong. Here is the

scoop straight from the author.


dstp ( aka the data socket server) : tcp
logos: udp
opc: (varies on connection settings)

So typical datasocket connection uses tcp. Again, there is no queuing
though, and you are not guaranteed to read every point written, and in
many situations where the read is simply timed, you may also read the
same value multiple times.

Greg McKaskle
0 Kudos
Message 4 of 5
(3,177 Views)
I was finally able to run my experiment and poll the active ports with netstat and discovered the same thing: datasocket uses TCP.

We were/are using a "handshaked/buffered" datasocket to stream some data from a real time system to a datalogging PC. After a few minutes the datalogging PC "hangs" on the datasocket (RT system is still filling the buffer, but datalogging PC no longer receiving packets, DS sever running on the datalogging PC). We were wondering if our handshake signals were being lost (ala UTP packets disappearing into the ether). Since thats not the case, we will investigate our "packets too big" theory as it seems to coincide with our buffer getting big (we flush and send the whole buffer each time the we get an "ack" fro
m the datalogging PC).

Thanks for your help, Greg.
Message 5 of 5
(3,177 Views)