convenience functions for checking send/recv success