Skip to content

Commit

Permalink
Remove wrong RPC timeout implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Aug 6, 2024
1 parent 1b7b187 commit f2aedcf
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/necrolog
2 changes: 0 additions & 2 deletions libshviotqt/include/shv/iotqt/rpc/rpccall.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class SHVIOTQT_DECL_EXPORT RpcResponseCallBack : public QObject
void start(int time_out_msec, QObject *context, CallBackFunction cb);
void abort();
virtual void onRpcMessageReceived(const shv::chainpack::RpcMessage &msg);
private:
void onConnectionDataReadyRead();
private:
CallBackFunction m_callBackFunction;
QTimer *m_timeoutTimer = nullptr;
Expand Down
1 change: 0 additions & 1 deletion libshviotqt/include/shv/iotqt/rpc/socketrpcconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class SHVIOTQT_DECL_EXPORT SocketRpcConnection : public QObject, public shv::cha
Q_SIGNAL void socketConnectedChanged(bool is_connected);
Q_SIGNAL void socketError(const QString &error_msg);
Q_SIGNAL void sslErrors(const QList<QSslError> &errors);
Q_SIGNAL void socketDataReadyRead();
void ignoreSslErrors();

std::string peerAddress() const;
Expand Down
11 changes: 0 additions & 11 deletions libshviotqt/src/rpc/rpccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,9 @@ RpcResponseCallBack::RpcResponseCallBack(ClientConnection *conn, int rq_id, QObj
{
setRequestId(rq_id);
connect(conn, &ClientConnection::rpcMessageReceived, this, &RpcResponseCallBack::onRpcMessageReceived);
connect(conn, &ClientConnection::socketDataReadyRead, this, &RpcResponseCallBack::onConnectionDataReadyRead);
setTimeout(shv::iotqt::rpc::ClientConnection::defaultRpcTimeoutMsec());
}

void RpcResponseCallBack::onConnectionDataReadyRead()
{
// restart timeout timer everytime when some data are read
// jumbo messages can time-out withou this simply because
// they are received too long
if(m_timeoutTimer && m_timeoutTimer->isActive()) {
m_timeoutTimer->start();
}
}

void RpcResponseCallBack::start()
{
m_isFinished = false;
Expand Down
1 change: 0 additions & 1 deletion libshviotqt/src/rpc/socketrpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void SocketRpcConnection::onReadyRead()
for (const auto &frame : frames) {
onFrameDataRead(frame);
};
emit socketDataReadyRead();
}

void SocketRpcConnection::onParseDataException(const chainpack::ParseException &e)
Expand Down

0 comments on commit f2aedcf

Please sign in to comment.