Ok, I figured it out. The reason I couldn't reproduce this before is that I was using labview 7.1. This was a bug that was fixed in labview 7.1. It occurs when, on an RT target, a VI waits for a connection, and then immediately tries to write data to that connection when it is opened (which is what you are doing). There are two ways to get around this:
1) Add some sleep right after the "TCP Listen". In my tests 2ms was sufficient, but you can play around with it and see how much is neccessary. It varies by target. If you put in 10ms, you would almost certainly be safe. Just make sure the wait takes place after the TCP Listen and before the first TCP Write.
2) Upgrade to labview 7.1. This bug is fixed in the newer version.