[Top][All Lists]

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

Re: [lwip-users] event callback in lwip sockets

From: bernard
Subject: Re: [lwip-users] event callback in lwip sockets
Date: Sat, 18 Feb 2017 16:52:57 +0800

Thank Simon, 
Yes, there are more changes in sockets.c, and the similar event handler should be added in my_callback. I mean, that LWIP_ASSERT can be ignore. Maybe I can provide the modification later, thanks. 

Best Regards, 
Bernard Xiong

2017-02-16 4:01 GMT+08:00 address@hidden <address@hidden>:
bernard wrote:
Because I need to implement the poll(struct pollfd *fds, nfds_t nfds, int timeout) routine between bsd socket and device fd etc. I have to set the callback to my event callback, then notify upper layer for different kind of fd poll/select. For example:
conn->callback = my_event_callback;

however, there is a ASSERT to check the callback in lwip_accept function:
LWIP_ASSERT("newconn->callback == event_callback", newconn->callback == event_callback);

In the next lwIP version, can it be removed from lwip_accept? thanks.

No. It's not as simple as that. As you might have noticed when reading the code, event_callback controls rcvevent, sendevent and errevent.
While sendevent and errevent are only used for select, rcvevent is used to implement nonblocking sockets, so to remove that callback, the nonblocking code would have to be patched out of sockets.c, too.

You seem to change the code to exchange your socket's netconn->callback, so you can make the ASSERT change as well.


lwip-users mailing list

reply via email to

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