Hi Noam, Just to clarify another thing, is the environment where you are trying to use lwip_select also uses select for file descriptors ? If yes then there is a possibility of malfunctioning as if I am not wrong lwip_select is not meant to be used with file descriptors as opposed normal BSD style select which is normally meant for both file and socket descriptors.
I used to face similar problems when porting lwip to an RTOS with POSIX compliance / BSD-style API support. If this is not the case, then probably I have no clue what might be causing this malfunctioning as I don't have the code and environment you are using. -- Thanks & Regards, ARPIT AGARWAL Alumni, Department Of CSE IIT Guwahati-781039 (INDIA) M: (+91)-8792793063 E: arpi...@alumni.iitg.ernet.in arpit0...@gmail.com ----------------------------------------------------------------------------------------- “ The greater part of progress is the desire to progress. ” — Seneca ________________________________ From: lwip-users <lwip-users-bounces+arpit.a=alumni.iitg.ernet...@nongnu.org> on behalf of Noam Weissman <n...@silrd.com> Sent: Wednesday, May 31, 2017 5:52 PM To: Tim Cussins; Mailing list for lwIP users Subject: Re: [lwip-users] LwIP 1.41 select does not return ? Hi Arpit, Thanks for the reply. I am not saying that lwip_select is the problem, I am using the socket API in in another application that I wrote and have no problems. It works as expected. The code I am trying to debug (not my code) is layered and is planed to portable to many systems (different OS, different TCP stack etc...). Just to clarify I do not have timeout on select, I just mentioned that I added time struct to select function call instead of the NULL (original code) just to see if it returns at all, and it did as expected. If I understand correctly lwip_select calls a function in sys_arch that creates a system semaphore. This is probably added in some linked list and when a connection is made it is released etc.. For some reason it is never released for that code I am using. It may be some define I missed, OS priority or something else that I am missing. Thanks, any ideas ? BR, Noam. ________________________________ From: lwip-users <lwip-users-bounces+noam=silrd....@nongnu.org> on behalf of Arpit Agarwal <arpi...@alumni.iitg.ernet.in> Sent: Wednesday, May 31, 2017 2:30 PM To: Tim Cussins; Mailing list for lwIP users Subject: Re: [lwip-users] LwIP 1.41 select does not return ? Hi Noam, I think lwip_select is not the problem. I have used it previously and it used to works with lwip 1.4.1 version. However as per your saying that select gets timeout, I would recommend you to debug event_callback API and verify if the socket descriptor you used in select has received the event_calback properly or not. If there is no event_callback cming for the particular socket descriptor then select will not return and it eventually timeouts. Thanks, Arpit -- Thanks & Regards, ARPIT AGARWAL Alumni, Department Of CSE IIT Guwahati-781039 (INDIA) M: (+91)-8792793063 E: arpi...@alumni.iitg.ernet.in arpit0...@gmail.com ----------------------------------------------------------------------------------------- “ The greater part of progress is the desire to progress. ” — Seneca ________________________________ From: lwip-users <lwip-users-bounces+arpit.a=alumni.iitg.ernet...@nongnu.org> on behalf of Noam Weissman <n...@silrd.com> Sent: Wednesday, May 31, 2017 4:49 PM To: Tim Cussins; Mailing list for lwIP users Subject: Re: [lwip-users] LwIP 1.41 select does not return ? Hi Tim, I am aware of that but that did not answer my question. You can mix API's and I already have systems that use RAW API and Socket API and they coexists when you know the limitations. My question was simple ... does anyone have an idea why select does not return when a connection to the correct port is initiated. Just to clarify the last 3 parameter to select function are all NULL. When I set the last parameter to a time struct (for testing) and defined 5 seconds timeout, select did return every 5 seconds with 0... It should be something that I overlooked or maybe that lwip_select is not 100% BSD compliant as CypherBridge code is ? Thanks and BR, Noam. ________________________________ From: Tim Cussins <timcuss...@eml.cc> Sent: Wednesday, May 31, 2017 1:57 PM To: Noam Weissman; Mailing list for lwIP users Subject: Re: [lwip-users] LwIP 1.41 select does not return ? Hi Noam, On Wed, May 31, 2017, at 11:11 AM, Noam Weissman wrote: > I am using a base project that is used for testing. This base project > uses FreeRTOS 8.01 + LwIP 1.41 > + a few modules that work just fine. The base project has a DHCP client > and a TCP server (Raw API) > that work just fine. > > > I have enabled sockets and netcon in lwipopts.h ... in general it seems > to load properly and run. > My own TCP server that listens on port 23 and the rest of the system > works just fine > > > Any ideas what did I miss or what should I check ? > Just a quick check: The raw API is not meant to be used in a multi-threaded system. Is your working TCP server using this API? If so, I expect your TCP server would work, but your calls to the netconn API (or sockets, which uses netconn under the hood) would probably dead-end in the way you're seeing. Have a look at the first couple of paragraphs here: http://lwip.wikia.com/wiki/Netconn_API Netconn API | lwIP Wiki | Fandom powered by Wikia<http://lwip.wikia.com/wiki/Netconn_API> lwip.wikia.com The netconn API is a sequential API designed to make the stack easier to use (compared to the event-driven raw API) while still preserving zero-copy functionality. HTH, Tim
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users