View Single Post
  #2   Spotlight this post!  
Unread 02-09-2012, 01:01
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 148
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Re: TCP communication with cRIO

I'm not sure exactly what is wrong but I think you need a different architecture for your tcp server code on the robot. We were able to get things working using the examples on this website:

http://beej.us/guide/bgnet/

In particular, our "server" code uses 'select' to see if any of the clients have anything to say. We can then "poll" rather than putting our robot code inside of an infinite loop like you're having to do. This page has some information on using 'select':

http://beej.us/guide/bgnet/output/ht...ed.html#select

Using this, our server code was all inside a function call rather than the other way around and we didn't have to spawn any tasks.

Hope this helps!