lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Multi-Threaded netconn API TCP application


From: Darius Babrauskas
Subject: Re: [lwip-users] Multi-Threaded netconn API TCP application
Date: Thu, 24 Sep 2015 16:52:17 +0300

Correction:
http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2Fpthread_cond_timedwait.html&resultof=%22pthread_cond_timedwait%22

-----Pirminis laiškas----- From: Darius Babrauskas
Sent: Thursday, September 24, 2015 10:36 AM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Multi-Threaded netconn API TCP application

Congratulations, Mihai!


From: Pîrvu Mihai
Sent: Wednesday, September 23, 2015 12:58 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Multi-Threaded netconn API TCP application

Yeah, the problem was that my MEMP_NUM_NETBUF was set to only 2. I have increased this and now it works.

Thanks for the help guys, keep the good code running :)

Mihai

On Tue, Sep 22, 2015 at 11:10 PM, Sylvain Rochet <address@hidden>
wrote:

Hi Darius,


On Tue, Sep 22, 2015 at 05:01:27PM +0300, Darius Babrauskas wrote:
Hi Mihai,

It looks that you have problems with systimeouts. Each tread must have
self systimeout stuct.

I disagree, only the lwIP core thread handle timeouts. Maybe your design
outside of lwIP require a timeout callout system in each thread but
that's not the case for lwIP.

Yes, you are right.
About systimeouts I found her(old info):
http://lwip.wikia.com/wiki/Porting_for_an_OS

But I see in version LWIP  1.4.1  lwip not using systimeouts  in sys.c file.
It's Ok, because user don’t must create socket tread  with sys_thread_new
function, which create systimeouts struct. And after delete thread not need
release  systimeouts.  In linux ports, not need use  sys_thread_new ,
because it adding when call currentthread function.




create_thread("client", client, (void *)&session_index);

//PS: The application runs on Linux atm, using lwip 1.4.0 (last stable one), the unix port from contrib directory and the clients connect using netcat <ip> <port>.
If you using Linux, why you use LWIP?  Are you want testing?

Of course he want to test and understand how to use the stack before
putting it to a microcontroller with boring flash-time and less debug
capabilities, and he is right to do so ;-)


It seem to me, that linux port not very good implemented. Maybe for
simple testing.

You can't claim that without explaining why, could you tell why it is
"not very good implemented" ?
Sylvain

Its my opinion, because some year ago my experience was not successful with
linux port (works but unstable) .

In current linux  port I have a sighting in function "cond_wait" which using
gettimeofday:
We have depends to system time adjustments (ntp, user ...)
Maybe better solution use CLOCK_MONOTONIC... example her:
http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fs%2Fsem_timedwait.html
Correction:
http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2Fpthread_cond_timedwait.html&resultof=%22pthread_cond_timedwait%22

Darius


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]