> The trick is to only discard one byte instead of the whole >buffer or a whole packet's worth of bytes. Then the receiver A good way to synch yourself is to use a mechanism such as this: void sendc (char c) { if (c >= 0xe0) { putc (0x1b); putc (c); } else putc (c + 0x20); } void sendmsg (char *s, int count) { int i; char c; putc (0x02); for (i = 0; i < count; i++) { c = *s++; sendc (c); CRC = crcfunc (CRC, c); } s = (char*)&CRC; for (i = 0, i < sizeof (CRC); i++) sendc (*s++); putc (0x0d); } While this is not perfect (because the CRC should be handled as a network-level thing) is does work quite well. The code above is also generic enough that it should compile pretty easily on your machine - just define a few variables (CRC and the message you are sending) and the crcfunc(). The receiving end simply looks until it reads a 0x02, then reads and buffers all chars until a) it detects the 0x0d, which causes it to validate and forward the message, or b) it detects a buffer overrun, which causes it to look for the 0x02 aga in. The receiver code is almost as simple, and is "left as an exercise for the student." Hope this helps. We use this ALL the time. Andy ================================================================== Andy Kunz Life is what we do to prepare for Eternity ------------------------------------------------------------------ andy@rc-hydros.com http://www.rc-hydros.com - Race Boats andy@montanadesign.com http://www.montanadesign.com - Electronics ==================================================================