This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Socket 操作能否实现回调机制?



请问,在L4还有L2层操作socket的时候,使用non-blocking方式,在发送或接收完成后,能否产生事件中断来执行相应处理代码?

在不使用操作系统的情况下,阻塞方式等待接收影响代码执行效率,非阻塞方式每次循环执行sl_recv 也很占时间,而且不稳定,出现异常。