MCPcopy Create free account
hub / github.com/Icinga/icinga2 / Connect

Method Connect

lib/base/unixsocket.cpp:40–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void UnixSocket::Connect(const String& path)
41{
42 sockaddr_un s_un;
43 memset(&s_un, 0, sizeof(s_un));
44 s_un.sun_family = AF_UNIX;
45 strncpy(s_un.sun_path, path.CStr(), sizeof(s_un.sun_path));
46 s_un.sun_path[sizeof(s_un.sun_path) - 1] = '\0';
47
48 if (connect(GetFD(), (sockaddr *)&s_un, SUN_LEN(&s_un)) < 0 && errno != EINPROGRESS) {
49 BOOST_THROW_EXCEPTION(posix_error()
50 << boost::errinfo_api_function("connect")
51 << boost::errinfo_errno(errno));
52 }
53}
54#endif /* _WIN32 */

Callers

nothing calls this directly

Calls 2

posix_errorClass · 0.85
CStrMethod · 0.80

Tested by

no test coverage detected