Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

126 server keeps opening tcp connections #140

Merged
merged 2 commits into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Release 3.6.3
Release 3.6.3 (2019-03-05)
------------------------------------------------------------

**Bugs**:

* delete discovery client connection on error #126, by @huebl
* fix calling stop monitored item callback #132, by @flipback

**Documentation**:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017 Kai Huebl ([email protected])
Copyright 2017-2019 Kai Huebl ([email protected])

Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser
Datei nur in Übereinstimmung mit der Lizenz erlaubt.
Expand Down Expand Up @@ -70,6 +70,7 @@ namespace OpcUaStackClient
sessionServiceConfig.sessionServiceIf_ = this;
sessionServiceConfig.secureChannelClient_->endpointUrl(discoveryUri_);
sessionServiceConfig.mode_ = SessionService::M_SecureChannel;
sessionServiceConfig.session_->reconnectTimeout_ = 0;
serviceSetManager_.registerIOThread("DiscoveryIOThread", ioThread_);
serviceSetManager_.sessionService(sessionServiceConfig);

Expand Down
10 changes: 8 additions & 2 deletions src/OpcUaStackCore/SecureChannel/SecureChannelClient.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2015-2018 Kai Huebl ([email protected])
Copyright 2015-2019 Kai Huebl ([email protected])

Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser
Datei nur in Übereinstimmung mit der Lizenz erlaubt.
Expand Down Expand Up @@ -301,7 +301,13 @@ namespace OpcUaStackCore
secureChannelClientIf_->handleDisconnect(secureChannel);

// start reconnect timer
if (reconnectTimeout_ == 0) return;
if (reconnectTimeout_ == 0) {
Log(Info, "secure channel closed")
.parameter("Address", secureChannel->partner_.address().to_string())
.parameter("Port", secureChannel->partner_.port());
delete secureChannel;
return;
}
slotTimerElementReconnect_->expireFromNow(reconnectTimeout_);
slotTimerElementReconnect_->callback().reset(boost::bind(&SecureChannelClient::handleReconnect, this, secureChannel));
ioThread_->slotTimer()->start(slotTimerElementReconnect_);
Expand Down