Hi there,
What do you mean with "You can however post your callback to be executed on > lwip thread"? What callback do you talk about, the callback function that is given as > parameter in the dns_gethostbyname? both "netconn api" and "socket api use "raw api" under the hood, those APIs handle inter thread communication for you. You can do something similar if you need to execute code on tcpip_thread from your code. Just use function: tcpip_callback_with_block This function simply takes function pointer, void * argument (to pass additional context to your function if it is needed), and uses RTOS mechanisms to execute in on tcpip thread (extra argument determines if current thread will block until execution on tcpip thread completes). You need to prepare your own functions: - one responsible for starting request, which will call dns_gethostbyname and will be passed to tcpip_callback_with_block, - one responsible for handling result of request, passed to dns_gethostbyname. This function will be called by dns code on tcpip thread when requests completes. Unfortunately I do not have sample at hand. Regards, Krzysztof Wesołowski
_______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
