MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / open

Method open

base/poco/Net/src/RemoteSyslogChannel.cpp:73–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73void RemoteSyslogChannel::open()
74{
75 if (_open) return;
76
77 if (_logHost.find(':') != std::string::npos)
78 _socketAddress = SocketAddress(_logHost);
79 else
80 _socketAddress = SocketAddress(_logHost, SYSLOG_PORT);
81
82 // reset socket for the case that it has been previously closed
83 _socket = DatagramSocket(_socketAddress.family());
84
85 if (_host.empty())
86 {
87 try
88 {
89 _host = DNS::thisHost().name();
90 }
91 catch (Poco::Exception&)
92 {
93 _host = _socket.address().host().toString();
94 }
95 }
96
97 _open = true;
98}
99
100
101void RemoteSyslogChannel::close()

Callers

nothing calls this directly

Calls 8

SocketAddressClass · 0.50
findMethod · 0.45
familyMethod · 0.45
emptyMethod · 0.45
nameMethod · 0.45
toStringMethod · 0.45
hostMethod · 0.45
addressMethod · 0.45

Tested by

no test coverage detected