sockets: speed up event_callback: don't iterate select_cb_list for NETCONN_EVT_RCVPLUS/SENDPLUS if the socket has been readable/writable before already

This commit is contained in:
goldsimon 2017-04-12 09:12:55 +02:00
parent 58c21eb13c
commit 064044eeae

View File

@ -2049,13 +2049,18 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
/* Set event as required */ /* Set event as required */
switch (evt) { switch (evt) {
case NETCONN_EVT_RCVPLUS: case NETCONN_EVT_RCVPLUS:
sock->rcvevent++; if (sock->rcvevent++ > 0) {
goto no_select_wakeup;
}
break; break;
case NETCONN_EVT_RCVMINUS: case NETCONN_EVT_RCVMINUS:
sock->rcvevent--; sock->rcvevent--;
goto no_select_wakeup; goto no_select_wakeup;
break; break;
case NETCONN_EVT_SENDPLUS: case NETCONN_EVT_SENDPLUS:
if (sock->sendevent) {
goto no_select_wakeup;
}
sock->sendevent = 1; sock->sendevent = 1;
break; break;
case NETCONN_EVT_SENDMINUS: case NETCONN_EVT_SENDMINUS: