Jump to content

Combining 2 lines TCP into 1 line


Papang

Recommended Posts

Hi Lavas,

I was creates 2 TCP programs, client andserver.

Client side is open connection and there aretwo functions provided, first are receive the image from the server and second aresend request of Boolean to the server.

Server side is listen connection and there arealso two functions provided, first are send the image to the client and secondare receive request of Boolean from the client.

My questions are:

Can I combine those two functions into one lineTCP connection (because my current programs at two lines TCP connection) and putit into case structure so I can play the connections several time duringprogram running?

I was try but it no works and some errors comeout so I make it back to standard.

Hope anyone can help me..

Thank you.

Client.vi

Server.vi

Link to comment

Take a look at Data Client.vi and Data Server.vi in the NI examples.

It uses 1 channel. The client sends back the letter Q to the server (on the same connection) to stop the server sending data.

Oh. And you can get the IP address by using "IpTostr" and "StrToIP" instead of executing IPconfig and formatting the result.

(I'd post a picture, but for some reason image uploading is failing)

Edited by ShaunR
  • Like 1
Link to comment

Take a look at Data Client.vi and Data Server.vi in the NI examples.

It uses 1 channel. The client sends back the letter Q to the server (on the same connection) to stop the server sending data.

Oh. And you can get the IP address by using "IpTostr" and "StrToIP" instead of executing IPconfig and formatting the result.

(I'd post a picture, but for some reason image uploading is failing)

Weird. Upload fails if I change from quick to full edit. But straight reply is fine.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.