LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems of using TCP in CVI

Hello,

When the data exchange between a client and the server being executing , assuming at the client side , a user also request view the data record (just be a text file) via the same TCP port at the same time , if it would block the original communication ? Thanks .

David
0 Kudos
Message 1 of 3
(3,128 Views)
Dave,

Are you talking about viewing same data (which is being transferred) or
transferring additional data while original transfer is happening?

If first option, it is easy, just display data as you read it.

For second option:-
TCP is IPAddress/PortNo from 1 machine to IPAddress/PortNo on another
machine. It is connection orientated. Once you sending something using a
connection (IPAddress/PortNo pair), you can not send additional stuff at
same time using same connection. But nothing prevents you from using a
different PortNo, create another tcp connection between server & client
and transfer additional data on that separate connection. and it can
happen at same time.

Also I would suggest reading an introductory book on tcp/ip.


vishi


davidLee wrote:
>
Hello,
>
> When the data exchange between a client and the server being executing
> , assuming at the client side , a user also request view the data
> record (just be a text file) via the same TCP port at the same time ,
> if it would block the original communication ? Thanks .
>
> David
0 Kudos
Message 2 of 3
(3,128 Views)
David,

Usually the server is the one that will handle the connections. You can have multiple connections, is just a matter of organizing which one is which. In the TCP server example that ships with CVI, there is a simple way to check if a connection is already made, if so the server rejects the connection.

What you can do here is you decline the connection on that port and then let the client try to open a connection in another port.

Anyway you go it is important that you control who is connected and for how long. If the transfers are short, you can just decline the connection of a second client and let the client wait for a random time and try again to see if the server is ready then.

Just some ideas....

Regards,

Juan Carlos
N.I.
0 Kudos
Message 3 of 3
(3,128 Views)