Add basic logic for recv()