Hi,

This is a known problem: the standard NetNameResolver (which depends on some 
primitives) hangs when your network connection is bad (or in a dubious state).

This is very annoying, if your test is 'do I have an internet connection'.

This is the reason why I played with https://github.com/svenvc/NeoDNS doing a 
pure Pharo DNS client (based on datagrams) - this one does never hang. But 
doing a full DNS client is hard. BTW, this code base also contains a 'do I have 
an internet connection' test.

Sven

> On 10 Apr 2020, at 13:15, dario.trussardi65 <[email protected]> 
> wrote:
> 
> Ciao,
> 
>       i have a Pharo 7.0.3 image run on Ubuntu system.
> 
>       Sometime the internet connection go down.
> 
>       In this status when i do the:
> 
>               NetNameResolver addressForName:  'www.esug.org'  timeout: 1
> 
>       the system is busy for 20 seconds ( for any request ).
> 
>       The             timeout: 1      is not considered.
> 
>       Question:  how i can test if the internet connection is up before 
> submit any NetNameResolver request ?
> 
>       Googling in VisualBasic i found the ActiveConnection
> 
>               It return true if internet connection is active.
> 
>       Equivalent in Pharo - Gemstone ?
> 
>       Thanks,
> 
>               Dario


Reply via email to