Allow RemoteSyslogChannel to be used again after being closed.

This commit is contained in:
Mike Naquin
2013-05-20 12:21:18 -05:00
parent 9ad116745b
commit a9284393b0

View File

@@ -89,6 +89,9 @@ void RemoteSyslogChannel::open()
{ {
if (_open) return; if (_open) return;
// reset socket for the case that it has been previously closed
_socket = DatagramSocket();
if (_logHost.find(':') != std::string::npos) if (_logHost.find(':') != std::string::npos)
_socketAddress = SocketAddress(_logHost); _socketAddress = SocketAddress(_logHost);
else else
@@ -105,6 +108,8 @@ void RemoteSyslogChannel::open()
_host = _socket.address().host().toString(); _host = _socket.address().host().toString();
} }
} }
_open = true;
} }