Servos act erratic when using TCP

I have a WiFi controlled robot. Originally I used an Arduino Mega with a WiFi shield. I have replaced that with the Yun.

For the Mega I used UDP to communicate and it was working fine. For the Yun I have changed over to TCP. I use the Yunserver and Yunclient. I'm using the standard Arduino servo library.

I have enabled a debug mode to write values to the console to make sure it's not an issue with communications. The values are coming over as expected. My TCP packets send values from 0 to 180 for the servos. when sending a value of 0, the servo should go all the way one direction. When sending 180 it should go all the way the other direction.

Standard servos expect pulses from 1 ms to 2 ms wide every 20 ms. I'm guessing that the interrupts for the incoming packets are interrupting the timing and the pulses are not at the correct timing.

If I run the servo sweep example, the servos react fine. Its only when I enabled networking that they get messed up.

I have moved the servos around to different I/O pins and I get the same results.

Have anyone else seen this? Does anyone have any ideas for how to resolve this?

My hypothesis was wrong. There is no issue with the Yun or my sketch. The issue turned out that my PC program was encoding the bytes as ASCII. So for values from 0 to 127 they were making it through correctly. For values greater than 127, it was changing the values to a 7 bit byte. So I believe the vales from 128 to 180 were coming through as 127 lower. If I sent 180 it changed it to 53 and the servo went to somewhere I didn't expect.

Now I just have to fix my PC program.