lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] dns_gethostbyname


From: Sandra Gilge
Subject: Re: [lwip-users] dns_gethostbyname
Date: Sun, 3 May 2015 14:43:34 +0200

Hallo 

Thanks for your answer. But I fear I don't understand it.
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?
Maybe you have an example?

Best regards,
Sandra

----------------------------------------------------------------------

Message: 1
Date: Thu, 30 Apr 2015 10:37:27 +0200
From: "Sandra Gilge" <address@hidden>
To: <address@hidden>
Subject: [lwip-users] dns_gethostbyname
Message-ID: <address@hidden>
Content-Type: text/plain; charset="us-ascii"

Hallo,

 

I'm using lwip 1.4.1 with sockets in a multithreaded system. Still I want to
use dns_gethostbyname directly because it is non-blocking.

I can't use getaddrinfo because it is blocking (furthermore it seems to have
problems, when lwip is reconfigured and dns_init is called a second time
during runtime, then it blocks forever, but that is another issue)

 

It is stated that dns_gethostbyname is for the raw-api. Is there a reason to
use it in combination with sockets? Is there a thread safety issue?

 

Best regards,

Sandra

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.nongnu.org/archive/html/lwip-users/attachments/20150430/798faf
4a/attachment.html>

------------------------------

Message: 2
Date: Thu, 30 Apr 2015 18:47:21 +0200
From: Krzysztof Weso?owski <address@hidden>
To: Mailing list for lwIP users <address@hidden>
Subject: Re: [lwip-users] dns_gethostbyname
Message-ID:
        <address@hidden>
Content-Type: text/plain; charset="iso-8859-2"

On Thu, Apr 30, 2015 at 10:37 AM, Sandra Gilge <address@hidden> wrote:

> It is stated that dns_gethostbyname is for the raw-api. Is there a 
> reason to use it in combination with sockets? Is there a thread safety
issue?


AFAIR dns_gethostbyname  uses other tcpip thread only components, so using
it from outside this thread can be unsafe.

You can however post your callback to be executed on lwip thread - it is
usually sufficient (we use similar patter to handle incoming udp data via
callback in tcpiip thread instead of blocking with netconn).

Regards,
Krzysztof Weso?owski
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.nongnu.org/archive/html/lwip-users/attachments/20150430/fb67bc
5c/attachment.html>

------------------------------

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

End of lwip-users Digest, Vol 141, Issue 1
******************************************




reply via email to

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