send/receive loop