split next_message() a slect() and a recv()