Feed in Unity through TCP

Hi guys!

So I’ve created a basic script for a Unity feed but I’m still having a couple issues. I’m programming in C# so hopefully one of you guys could help me out a bit on this:

  1. Right now I have it set to a fixed 141 bytes per line. Is there a way of telling the software to check a line length before retrieving data? My biggest problem here is because of lat/long digit length changes. I was thinking of writing a prompt for user lat long prior to start so it can decide how many bytes it needs to receive but I’d rather not if possible.
  2. Is there a way of withdrawing a line based on a point in time a button is clicked or the request for receive is made? I have to have the system logging every 0.2 seconds once activated which is alright, but the real problem is before I discovered this. I had to tell it to log every 0.2 seconds because at first, I told it to receive data based on an input click. The input was not reading that moment in time. The input was reading the next line in the sequence. So if the button was pressed 10 seconds later, the received result will still be only 0.2 seconds after the previous click. This is a problem because even if I have it updating in a sync rate, if the system ever ends up out of sync the error will accumulate.
  3. At the moment I plan on having the realtime feed activated then an input routine that will just grab the most recently pulled data, but now you can see that if the device ever ends up getting out of sync then the time error will also accumulate. This can’t happen. I think however question 2 is solved will fix this problem, too.

Here’s a sample of my code at the moment. My inputs are called “CNinputmanager” because I’m using a prefab set that lets me link inputs to on-screen button objects.

Are you trying to get data from Reach to Unity or did you end up on a wrong forum? :slight_smile:

Actually I wasn’t sure if I should post it here since I was integrating into a smartphone, or if I should post it in post-processing since it’s programming. Either way it doesn’t really fit.

I managed to get the feed up and running, I’m still having difficulties closing and reopening the socket.

This topic was automatically closed after 100 days. New replies are no longer allowed.