Hi,

regarding the dirty trick I must admit I fear that it might cause a glitch thats right. I put it in eitherway as a proof of concept and running performance tests for evaluation of what might be possible. Since its a thesis i thought of investigating the delay and the impact on the performance. For actual use it shouldn't be in the code!

Since I am messing with the TCP timer I suppose that it can cause earlier/unwanted retransmissions and connection timeouts. For my application both doesn't pose to much of a threat at this point.


Regarding the suggest function if i understand it right i just set it up within a callback function and if the

sys_check_timeouts();

function is called and the localtime compared to the time when i set it up exceeds the intervall the function will be called. On that matter is it possible to assign 0 as intervall value so it will be called with the next sys_check_timeouts() ?


Also I want to say thank you for all your help.


sincerly,


Norbert


Am 24.09.2016 um 14:58 schrieb Noam Weissman:

Hi,


Doing some "dirty" trick will not help but cause other problems. IwIP can back-fire and

you will get unpredictable results. Problems that can be difficult to find.


sys_timeout is an LwIP function that runs inside the context of LwIP. Time interval is in milliseconds.


That means that if you set it to 100ms it will call your function (only once) when time elapses.


So instead of using the poll call back that is triggered at best every 0.5 seconds ... you can set your

own timeout function that will handle some house keeping at a faster rate. Do remember that if you

need it to periodically do something you need to set it again and again... until you finish the process.


BR,

Noam.



------------------------------------------------------------------------
*From:* lwip-users <[email protected]> on behalf of Norbert Kleber <[email protected]>
*Sent:* Saturday, September 24, 2016 11:20 AM
*To:* [email protected]
*Subject:* Re: [lwip-users] prioritizing of active connections

Hi Noam,


thank you for your suggestion. I guess I will start with an OS for the next project. For this one it's allready to late I am afraid (thesis due date next month). I didn't fully understand the explanation in the wiki regarding the sys_timeout(TMR_INTERVAL, function , NULL); function. Which timer triggers this function and how can i calculate the exact timing of the sys_timeout?

For now i found an quick and dirty approach which i can't recommand to anyone. I just call 2x tcp_tmr() directly after my computing work is done. This improves my performance. Where i needed 36 seconds for one run I now only need 16 seconds.


sincerly,

Norbert


Am 23.09.2016 um 18:30 schrieb Noam Weissman:

Hi Norbert,


First of all I would suggest changing your design and use an OS. I am running FreeRTOS

on STM micro's for 6 years now and I do not see myself doing it any other way.


The STM32F4 is a strong micro with sufficient power to do much more then you do now.


If you run an OS there will be a small overhead but your system design will be much simpler

to menage.


If you use Socket API you can send data outside of the LwIP context. If you use RAW API

you cannot send data from outside of the LwIP context and must take that into consideration:


First option protect the code that is called from outside of the LwIP context. Either by using a

critical section (OS).... or using the poll call back.... or triggering LwIP own system_timer call-back:


sys_timeout(TMR_INTERVAL, function , NULL);


The above is an LwIP internal timer handling. You pass the function you want (see prototype)

with or without parameters and it will be triggered when time expires.



BR,

Noam.


------------------------------------------------------------------------
*From:* lwip-users <[email protected]> on behalf of Norbert Kleber <[email protected]>
*Sent:* Friday, September 23, 2016 6:58 PM
*To:* [email protected]
*Subject:* [lwip-users] prioritizing of active connections
Hi evereyone,

I got some questions again.

I am using the lwIP on a STM32F4 mikrocontroller without OS. A client
will connect to the stack at two ports for transmission. First port will
be used for controlsignals and second for datatransmission. The whole
System works sequentially.

Firstly 1 package will be received on the ctrl connection afterwards we
receive many packages on the dataconnection. Now I was wondering that
the stack acknowlegded all data packages before he acknowledges the ctrl
package. Due to the operation of the µC I can tell that he received the
package right away and ofcause i use the acknowledgement function in the
receive function.  But somehow it is severly delayed approx. 200ms but
the later received data packages all get acknowledged right away.

Does the stack some prioritizing between open connections? Or is it due
to the Ctrl Package being quite short?

Also I am doing some computational work outside of the callback
functions and want to transmit some of the results asap over the ctrl
connection. Is there a way to do that without waiting for the polling
function? Or is there a way to trigger the polling function somehow for
a instant call? Also it seemed like i can't use tcp_write if i am
outside of a callback function (i was storing the pointer to the pcb in
a global variable).

sincerly,

Norbert


_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users
lwip-users -- Mailing list for lwIP users - lists.nongnu.org <https://lists.nongnu.org/mailman/listinfo/lwip-users>
lists.nongnu.org
Welcome to the lwip-users mailing list. Use it to ask questions, share your experience and discuss new ideas. To see the collection of prior postings to the list ...




_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to