Skip to content

Commit

Permalink
Add function ClientConnection::reopen()
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Oct 16, 2024
1 parent 5eabe03 commit 90f4da0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions libshviotqt/include/shv/iotqt/rpc/clientconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class SHVIOTQT_DECL_EXPORT ClientConnection : public SocketRpcConnection
virtual void open();
void close() override;
void abort() override;
void reopen();

void setCliOptions(const ClientAppCliOptions *cli_opts);

Expand Down
12 changes: 12 additions & 0 deletions libshviotqt/src/rpc/clientconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ void ClientConnection::abort()
closeOrAbort(true);
}

void ClientConnection::reopen()
{
if(isAutoConnect()) {
closeSocket();
restartIfAutoConnect();
}
else {
close();
open();
}
}

void ClientConnection::setCliOptions(const ClientAppCliOptions *cli_opts)
{
if(!cli_opts)
Expand Down

0 comments on commit 90f4da0

Please sign in to comment.