我正在一个套接字上进行一个非阻塞发送调用,然后在另一个套接字上进行阻塞接收。之后我想检查非阻塞发送是成功还是失败。如何才能做到这一点?
while (i)
{
retval = send (out_sd, s_message, strlen (s_message), MSG_DONTWAIT);
retval = recv (client_sd, r_message, MSG_LEN, 0);
r_message[retval] = '\0';
/* Here I want to wait for the non-blocking send to complete */
strcpy (s_message, r_message);
strcpy (r_message, "");
i--;
}