You have a 100mS delay in the transmission. What does read() on the PC side return of there is no data waiting to be read? Perhaps the opposite of what Nick suggested is happening, that the PC is reading fast enough to empty the UART on the receive side, causing read() to return 0, and therefore exiting your loop...