refactor network receive and correctly handle multi-packet messages