[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Using lwIP polled, but not with lwip_poll
From: |
Jörg F. Wittenberger |
Subject: |
Re: [lwip-users] Using lwIP polled, but not with lwip_poll |
Date: |
Mon, 17 Aug 2020 14:39:03 +0200 |
Am Fri, 14 Aug 2020 10:07:00 -0400
schrieb Matt Walker <m@allocor.tech>:
> Hi,
>
> I'm attempting to integrate lwIP into an embedded application
> framework that supplies its own poll like functionality. I would like
> to make it so that lwIP sockets can be added to the framework's
> implementation of poll rather than having a dedicated lwIP thread.
>
> I'd be interested in hearing if anyone has done this before, or if
> there's something I'm missing in the user APIs.
I went the alternative way to do something similar. define NO_SYS in
order to not have a dedicated pthread and than call sys_check_timeouts()
in a loop waiting for sys_timeouts_sleeptime() in between.
That might be easier.
> If there's not, what I'm roughly thinking is to move the definitions
> for lwip_poll_inc_sockets_used
> lwip_poll_dec_sockets_used
> lwip_pollscan
> lwip_link_select_cb
> lwip_unlink_select_cb
> into priv/sockets_priv.h; and set the semaphore in the callback to one
> that the framework gives for notifications. Basically trying to follow
> lwip_poll as much as possible, just without waiting on the OS inside.
>
> Any thoughts? And if I make the API change to move definitions into
> priv; is that something that anyone is interested in having upstream?
>
> Thanks,
> Matt Walker