The fatal errors have changed in CVS after 1.3.2: ERR_TIMEOUT is not a fatal error any more.
Simon "Sirjee Rooplall" wrote: > An: "Mailing list for lwIP users" <[email protected]> > Betreff: [lwip-users] LWIP 1.3.2 and PPP > Hi as stated above I am using LWIP 1.3.2 and the PPP stack. > > I use the follwoing API's. > netconn_new > netconn_connect > netconn_delete > netconn_recv - This is called from a freeRTOS task every 10ms, to check if > any data has arrived. > netbuf_data > > I have LWIP_SO_RCVTIMEO defined as 1. > > I am using PPP over serial through modem to sever. > > Before I call nettcon_recv to check for data I set a receive timeout: > pxSeverConnectionHandle->recv_timeout = 10000; // wait for incoming > message 10seconds max. > > Now here is the problem. > > Everything works fine provided the server replies within the 10 seconds. > If netconn_recv timeout, it sets the conn->err to conn->err = ERR_TIMEOUT; > // which is -13 and referred to FATAL error. > > The next time netconn_recev is called it encounter this piece of code > which says: > if (ERR_IS_FATAL(conn->err)) { > return NULL; > } > > because the conn->err is set to -13 which is fatal error, netconn_recv > always returns without checking the mailbox for a message which may take more > than 10 seconds to come. > > Now the reason I am using the receive timeout in netconn_recv is because > previously it wait forever for a message and if the message does not come, > after 20 seconds I close the socket in another Task, and that caused my > system to crash because netconn_recv was pending on that socket handle. > > In this system using PPP and modem + GPRS it is possible that a message > may not arrive, and retries are implemented etc to cater for this. > > My question is How do I work around this ERR_IS_FATAL condition, without > breaking any LWIP rules? > > > Kind Regards, > > > Sirjee Rooplall > Figment Design laboratories (Pty) Ltd > mailto: [email protected] > Mobile: +27 (0)83 230 8466 -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
