preCICE
v3.1.2
Loading...
Searching...
No Matches
src
utils
networking.cpp
Go to the documentation of this file.
1
#include "
utils/networking.hpp
"
2
3
namespace
precice::utils::networking
{
4
5
std::string
loopbackInterfaceName
()
6
{
7
#if defined(__linux__)
8
return
"lo"
;
9
#elif defined(__APPLE__) || defined(BSD)
10
return
"lo0"
;
11
#elif defined(__WIN32)
12
// Not required as we directly use the 127.0.0.1 under Windows
13
return
""
;
14
#else
15
#warning "Your target architecture does not define a loopback interface. Please consider reporting this to the preCICE developers."
16
return
""
;
17
#endif
18
}
19
20
}
// namespace precice::utils::networking
std::string
precice::utils::networking
Definition
networking.cpp:3
precice::utils::networking::loopbackInterfaceName
std::string loopbackInterfaceName()
Returns the name of the canonical loopback interface on this system.
Definition
networking.cpp:5
networking.hpp