<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Check internet connection from Fortran program in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253553#M154297</link>
    <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/150543"&gt;@SoniaG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Re: "..&amp;nbsp;&lt;SPAN&gt;I think I need to use the method GetConnectivity but can't find an example of this for use in Fortran. ..,&lt;/SPAN&gt;" you may have seen this at the Microsoft site:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/windows/win32/api/netlistmgr/nf-netlistmgr-inetworklistmanager-getconnectivity" target="_blank"&gt;https://docs.microsoft.com/en-us/windows/win32/api/netlistmgr/nf-netlistmgr-inetworklistmanager-getconnectivity&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You'll notice the GetConnectivity - which is indeed Microsoft's recommended method in their so-called unmanaged programs (and which is what all Fortran apps are) on Windows - is a C++ class method of INetworkListManager that is invokable via COM.&amp;nbsp; As such, you would either need to use Intel Fortran's COM interoperability module(s) or setup something yourself using C-Fortran interoperability.&amp;nbsp; Both are a little more effort than I would be willing to undertake, so I would instead write a small extern "C" wrapper function in C++ like so: it's a one-time effort easier to manage I feel:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;tchar.h&amp;gt;
#include &amp;lt;Windows.h&amp;gt;
#include &amp;lt;Netlistmgr.h&amp;gt;
#include &amp;lt;atlbase.h&amp;gt;

extern "C" int IsConnected(char *msg, size_t lenmsg) 
{ 

  int irc = 0;
  CoInitialize(NULL);
  {
    CComPtr&amp;lt;INetworkListManager&amp;gt; pNLM;
    HRESULT hr = CoCreateInstance(CLSID_NetworkListManager, NULL, 
      CLSCTX_ALL, __uuidof(INetworkListManager), (LPVOID*)&amp;amp;pNLM);
    if (SUCCEEDED(hr))
    {
      NLM_CONNECTIVITY con = NLM_CONNECTIVITY_DISCONNECTED;
      hr = pNLM-&amp;gt;GetConnectivity(&amp;amp;con);
      if SUCCEEDED(hr)
      {
        if (con &amp;amp; NLM_CONNECTIVITY_DISCONNECTED)
          snprintf(msg, lenmsg, "%s\n", "Disconnected");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_NOTRAFFIC)
          snprintf(msg, lenmsg, "%s\n", "IP4: No Traffic");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_NOTRAFFIC)
          snprintf(msg, lenmsg, "%s\n", "IP6: No Traffic");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_INTERNET)
          snprintf(msg, lenmsg, "%s\n", "IP4: Internet");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_LOCALNETWORK)
          snprintf(msg, lenmsg, "%s\n", "IP4: Local");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_SUBNET)
          snprintf(msg, lenmsg, "%s\n", "IP4: Subnet");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_INTERNET)
          snprintf(msg, lenmsg, "%s\n", "IP6: Internet");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_LOCALNETWORK)
          snprintf(msg, lenmsg, "%s\n", "IP6: Local");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_SUBNET)
          snprintf(msg, lenmsg, "%s\n", "IP6: Subnet");
      }
    }
    irc = (int)hr;
  }
  CoUninitialize();
  return irc; 
} &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And setup an interface to it in Fortran like so, again a one-time effort:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;module NetListMgr_m

   use, intrinsic :: iso_c_binding, only : c_char, c_int, c_size_t

   interface
      function IsConnected( Msg, LenMsg ) result(r) bind(C, name="IsConnected" )

      ! int IsConnected(char *msg, size_t lenmsg);

         import :: c_char, c_int, c_size_t

         ! Argument list
         character(kind=c_char, len=1), intent(in) :: Msg(*)
         integer(c_size_t), intent(in), value      :: LenMsg
         ! Function result
         integer(c_int) :: r

      end function 
   end interface

end module
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then the following Fortran test program can make use of it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;program TestConnection

   use, intrinsic :: iso_c_binding, only : c_char, c_size_t, c_int
   use NetListMgr_m, only : IsConnected
   
   character(kind=c_char, len=256) :: ConnectionState
   integer(c_size_t) :: lens
   integer(c_int) :: cstat

   lens = int( len(ConnectionState), kind=kind(lens) )
   cstat = IsConnected( ConnectionState, lens )
   print *, "ctsat: ", cstat
   print *, trim(ConnectionState)
   
end program 
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can tuck away the above C function and the Fortran module code in a library (static or DLL) and use it in your Fortran programs - Visual Studio projects can make this easy as you may know.&lt;/P&gt;
&lt;P&gt;From the command-line, for illustration purposes, you can expect the following behavior:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;C:\Temp&amp;gt;cl /c /EHsc /W3 IsConnected.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

IsConnected.cpp

C:\Temp&amp;gt;ifort /c /standard-semantics /warn:all /stand:f18 NetListMgr.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1.2 Build 20201208_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.


C:\Temp&amp;gt;ifort /c /standard-semantics /warn:all /stand:f18 TestConnection.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1.2 Build 20201208_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.


C:\Temp&amp;gt;link TestConnection.obj NetListMgr.obj IsConnected.obj /subsystem:console /out:TestConnection.exe
Microsoft (R) Incremental Linker Version 14.26.28806.0
Copyright (C) Microsoft Corporation.  All rights reserved.


C:\Temp&amp;gt;TestConnection.exe
 ctsat:  0
 IP4: Internet



C:\Temp&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;gt; Some of the above code is a bit more verbose than otherwise, but it's for the benefit of other readers also.&amp;nbsp; Also, it's possible Intel Fortran provides some module procedures for this - I've not checked - but that will be compiler-specific.&amp;nbsp; The above should work with any Fortran standard supporting compiler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 17:48:02 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2021-02-05T17:48:02Z</dc:date>
    <item>
      <title>Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253001#M154269</link>
      <description>&lt;P&gt;I want my Fortran program to check for internet connection and warn the user if not connected.&amp;nbsp; I think I need to use the method GetConnectivity but can't find an example of this for use in Fortran. Apparently the API,&amp;nbsp;&lt;SPAN&gt;InternetGetConnectedState is no longer recommended.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Any help or advice would be appreciated - manys thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 03:32:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253001#M154269</guid>
      <dc:creator>SoniaG</dc:creator>
      <dc:date>2021-02-04T03:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253127#M154272</link>
      <description>&lt;P&gt;Not quite the same thing but I use&amp;nbsp;&lt;SPAN class="hljs-title"&gt;URLDownloadToFile to download a page from the web to a local file. A failure to get something that is known to exist could be indicative of no connection.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 13:13:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253127#M154272</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2021-02-04T13:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253180#M154275</link>
      <description>&lt;P&gt;Experiment with EXECUTE_COMMAND_LINE with "ping -w 500 -n 1 yahoo.com&amp;gt;check.txt"&lt;/P&gt;
&lt;P&gt;You should test to see if exitstat returns error code when ping fails, and in which case you need not check the check.txt for ping error.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 15:47:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253180#M154275</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-02-04T15:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253184#M154276</link>
      <description>&lt;P&gt;&lt;A title="Nice answer" href="https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/td-p/813094" target="_self"&gt;https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-internet-connection-from-fortran/td-p/813094&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a rather interesting answer here from 2011 -- it should still work&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 15:59:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253184#M154276</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2021-02-04T15:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253375#M154290</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/63968"&gt;@jimdempseyatthecove&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have written the following code but, although the command execution runs, I almost always get an estat of 1.&amp;nbsp; My program is running in Windows and I am connected to the internet (it's a strong signal and not intermittant).&amp;nbsp; I get similar results whether running in debug (Visual Studio) or in production.&lt;/P&gt;
&lt;P&gt;If the code below looks ok, I assume there must be something else at play?&lt;/P&gt;
&lt;P&gt;call execute_command_line("ping -w 500 -n 1 yahoo.com&amp;gt;check.txt",exitstat=estat,cmdstat=cstat,cmdmsg=cmsg)&lt;BR /&gt;if(cstat &amp;gt; 0) then&lt;BR /&gt;&amp;nbsp; iret = messagebox(ghwndmain,'Command execution failed with error'//trim(cmsg)//char(0),'Check for&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; internet connection'//char(0),mb_ok)&lt;BR /&gt;else if(cstat &amp;lt; 0) then&lt;BR /&gt;&amp;nbsp; iret = messagebox(ghwndmain,'Command execution not supported'//trim(cmsg)//char(0),'Check for&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; internet connection'//char(0),mb_ok)&lt;BR /&gt;&amp;nbsp;else&lt;BR /&gt;&amp;nbsp; &amp;nbsp; write(cestat,'(I4)')estat&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if(estat==0)then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; iret = messagebox(ghwndmain,'Internet connection ok, estat ='//trim(cestat)//char(0),'Check for&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; internet connection'//char(0),mb_ok)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; else&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; iret = messagebox(ghwndmain,'No internet connection found, estat ='//trim(cestat)//char(0),'Check&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for internet connection'//char(0),mb_ok)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end if&lt;BR /&gt;end if&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 06:12:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253375#M154290</guid>
      <dc:creator>SoniaG</dc:creator>
      <dc:date>2021-02-05T06:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253483#M154296</link>
      <description>&lt;P&gt;What happens if you set the timeout to -w 5000?&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 13:19:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253483#M154296</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-02-05T13:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253553#M154297</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/150543"&gt;@SoniaG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Re: "..&amp;nbsp;&lt;SPAN&gt;I think I need to use the method GetConnectivity but can't find an example of this for use in Fortran. ..,&lt;/SPAN&gt;" you may have seen this at the Microsoft site:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/windows/win32/api/netlistmgr/nf-netlistmgr-inetworklistmanager-getconnectivity" target="_blank"&gt;https://docs.microsoft.com/en-us/windows/win32/api/netlistmgr/nf-netlistmgr-inetworklistmanager-getconnectivity&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You'll notice the GetConnectivity - which is indeed Microsoft's recommended method in their so-called unmanaged programs (and which is what all Fortran apps are) on Windows - is a C++ class method of INetworkListManager that is invokable via COM.&amp;nbsp; As such, you would either need to use Intel Fortran's COM interoperability module(s) or setup something yourself using C-Fortran interoperability.&amp;nbsp; Both are a little more effort than I would be willing to undertake, so I would instead write a small extern "C" wrapper function in C++ like so: it's a one-time effort easier to manage I feel:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;tchar.h&amp;gt;
#include &amp;lt;Windows.h&amp;gt;
#include &amp;lt;Netlistmgr.h&amp;gt;
#include &amp;lt;atlbase.h&amp;gt;

extern "C" int IsConnected(char *msg, size_t lenmsg) 
{ 

  int irc = 0;
  CoInitialize(NULL);
  {
    CComPtr&amp;lt;INetworkListManager&amp;gt; pNLM;
    HRESULT hr = CoCreateInstance(CLSID_NetworkListManager, NULL, 
      CLSCTX_ALL, __uuidof(INetworkListManager), (LPVOID*)&amp;amp;pNLM);
    if (SUCCEEDED(hr))
    {
      NLM_CONNECTIVITY con = NLM_CONNECTIVITY_DISCONNECTED;
      hr = pNLM-&amp;gt;GetConnectivity(&amp;amp;con);
      if SUCCEEDED(hr)
      {
        if (con &amp;amp; NLM_CONNECTIVITY_DISCONNECTED)
          snprintf(msg, lenmsg, "%s\n", "Disconnected");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_NOTRAFFIC)
          snprintf(msg, lenmsg, "%s\n", "IP4: No Traffic");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_NOTRAFFIC)
          snprintf(msg, lenmsg, "%s\n", "IP6: No Traffic");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_INTERNET)
          snprintf(msg, lenmsg, "%s\n", "IP4: Internet");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_LOCALNETWORK)
          snprintf(msg, lenmsg, "%s\n", "IP4: Local");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV4_SUBNET)
          snprintf(msg, lenmsg, "%s\n", "IP4: Subnet");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_INTERNET)
          snprintf(msg, lenmsg, "%s\n", "IP6: Internet");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_LOCALNETWORK)
          snprintf(msg, lenmsg, "%s\n", "IP6: Local");
        if (con &amp;amp; NLM_CONNECTIVITY_IPV6_SUBNET)
          snprintf(msg, lenmsg, "%s\n", "IP6: Subnet");
      }
    }
    irc = (int)hr;
  }
  CoUninitialize();
  return irc; 
} &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And setup an interface to it in Fortran like so, again a one-time effort:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;module NetListMgr_m

   use, intrinsic :: iso_c_binding, only : c_char, c_int, c_size_t

   interface
      function IsConnected( Msg, LenMsg ) result(r) bind(C, name="IsConnected" )

      ! int IsConnected(char *msg, size_t lenmsg);

         import :: c_char, c_int, c_size_t

         ! Argument list
         character(kind=c_char, len=1), intent(in) :: Msg(*)
         integer(c_size_t), intent(in), value      :: LenMsg
         ! Function result
         integer(c_int) :: r

      end function 
   end interface

end module
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then the following Fortran test program can make use of it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;program TestConnection

   use, intrinsic :: iso_c_binding, only : c_char, c_size_t, c_int
   use NetListMgr_m, only : IsConnected
   
   character(kind=c_char, len=256) :: ConnectionState
   integer(c_size_t) :: lens
   integer(c_int) :: cstat

   lens = int( len(ConnectionState), kind=kind(lens) )
   cstat = IsConnected( ConnectionState, lens )
   print *, "ctsat: ", cstat
   print *, trim(ConnectionState)
   
end program 
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can tuck away the above C function and the Fortran module code in a library (static or DLL) and use it in your Fortran programs - Visual Studio projects can make this easy as you may know.&lt;/P&gt;
&lt;P&gt;From the command-line, for illustration purposes, you can expect the following behavior:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;C:\Temp&amp;gt;cl /c /EHsc /W3 IsConnected.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

IsConnected.cpp

C:\Temp&amp;gt;ifort /c /standard-semantics /warn:all /stand:f18 NetListMgr.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1.2 Build 20201208_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.


C:\Temp&amp;gt;ifort /c /standard-semantics /warn:all /stand:f18 TestConnection.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1.2 Build 20201208_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.


C:\Temp&amp;gt;link TestConnection.obj NetListMgr.obj IsConnected.obj /subsystem:console /out:TestConnection.exe
Microsoft (R) Incremental Linker Version 14.26.28806.0
Copyright (C) Microsoft Corporation.  All rights reserved.


C:\Temp&amp;gt;TestConnection.exe
 ctsat:  0
 IP4: Internet



C:\Temp&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;gt; Some of the above code is a bit more verbose than otherwise, but it's for the benefit of other readers also.&amp;nbsp; Also, it's possible Intel Fortran provides some module procedures for this - I've not checked - but that will be compiler-specific.&amp;nbsp; The above should work with any Fortran standard supporting compiler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 17:48:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253553#M154297</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2021-02-05T17:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Check internet connection from Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253556#M154298</link>
      <description>&lt;P&gt;Sonia:&lt;/P&gt;
&lt;P&gt;FortranFan's method is as good as it gets, I would adopt this one and stop searching.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 18:09:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Check-internet-connection-from-Fortran-program/m-p/1253556#M154298</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2021-02-05T18:09:15Z</dc:date>
    </item>
  </channel>
</rss>

