Hi,
First of all, check you physical link. Send a large file using hyperterminal, zmodem protocol to the other side, using the same cable, and same speed like in your app. After completion (if succesfull), check the number of errors from z-modem window. If the number is 0, then the bug is in your program. If not, your connection is lossy. I had the same problem with data loss between a pc and a laptop, and the problem was a long cable with poor shielding running at 115200.
Best,