9 years, 8 months ago.

can anyone explain it??

I am working in websocketclient.cpp code in their i am getting struck in somewhre..whenever event_callback hapend it is making link to sockets.h (lwip)..In select_waiting() ...whyy it is happening to me..

event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len) { int s; struct lwip_sock *sock; struct lwip_select_cb *scb; SYS_ARCH_DECL_PROTECT(lev);

LWIP_UNUSED_ARG(len);

/* Get socket */ if (conn) { s = conn->socket; if (s < 0) { /* Data comes in right away after an accept, even though

  • the server task might not have created a new socket yet.
  • Just count down (or up) if that's the case and we
  • will use the data later. Note that only receive events
  • can happen before the new socket is set up. */ SYS_ARCH_PROTECT(lev); if (conn->socket < 0) { if (evt == NETCONN_EVT_RCVPLUS) { conn->socket; } SYS_ARCH_UNPROTECT(lev); return; } s = conn->socket; SYS_ARCH_UNPROTECT(lev); }

sock = get_socket(s); if (!sock) { return; } } else { return; }

SYS_ARCH_PROTECT(lev); /* Set event as required */ switch (evt) { case NETCONN_EVT_RCVPLUS: sock->rcvevent++; break; case NETCONN_EVT_RCVMINUS: sock->rcvevent; break; case NETCONN_EVT_SENDPLUS: sock->sendevent = 1; break; case NETCONN_EVT_SENDMINUS: sock->sendevent = 0; break; case NETCONN_EVT_ERROR: sock->errevent = 1; break; default: LWIP_ASSERT("unknown event", 0); break; }

if (sock->select_waiting == 0) { /* noone is waiting for this socket, no need to check select_cb_list */ SYS_ARCH_UNPROTECT(lev); return; }

Be the first to answer this question.