View Single Post
  #5   Spotlight this post!  
Unread 20-11-2013, 09:18
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: TCP problems in C#

Thank you guys for the replies!

I have to admit, I'm just learning TCP so please excuse any noob-ish mistakes I've made:/

Quote:
What you're calling the "server" is apparently sending data continuously, and what you're calling the "client" is apparently reading the accumulated data once every 20 milliseconds. Is that the intent?

Normally, I'd expect the client to send a packet of data either on a fixed schedule or whenever the data is available, and the server would wait for data to appear before reading it and processing it immediately.
That is the intent, yes. On the LV program, I was following a simple tutorial to write the string; do you have any tips on how I could accomplish what you've described?

Quote:
TCP is a stream protocol and guarantees that things will be received in the correct order, but they may be packetized differently then you expect. You can learn more by searching for nagle algorithm.

Why are you sending data with no delay in LabVIEW, but reading data every 20ms? You'll probably fill up the TCP/IP buffers fairly quickly.
I'm not sure I completely understand. Are you saying that, because I'm using LV to write and C# to read, there's a discrepancy in the packet order? And I didn't really pay attention to it, I was following a tutorial . Would it just be a ms timer in the loop?

Quote:
The code you have is extracting data from rData formatted as a string, where rData is the number of characters read from the socket stream. The actual data read from the stream is stored in info, which you aren't currently using
Oh, dangit. Careless mistake, haha. Fixed!


Do you guys think the problem is on the LV side or the C# side?
__________________
Per Audacia Ad Astra

Last edited by Invictus3593 : 20-11-2013 at 09:20.