Skip to content
Open
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
7 changes: 5 additions & 2 deletions rbkit-lib/subscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,11 @@ void Subscriber::performHandshake()
{
commandSocket->start(commandUrl);
switch (commandSocket->performHandShake()) {
case RBKit::HandShakeResponse::VERSION_MISMATCH:
emitConnectionError(QString("RBkit is unable to connect to Server because either Server or Desktop version is too old"));
case RBKit::HandShakeResponse::VERSION_MISMATCH_SERVER_OLD:
emitConnectionError(QString("RBkit is unable to connect to Server because Server version is too old"));
break;
case RBKit::HandShakeResponse::VERSION_MISMATCH_CLIENT_OLD:
emitConnectionError(QString("RBkit is unable to connect to Server because this client version is too old"));
break;
case RBKit::HandShakeResponse::VERSION_MATCH:
handShakeCompleted();
Expand Down
9 changes: 8 additions & 1 deletion rbkit-lib/zmqsockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ static const int timerIntervalInMs = 1000;

RBKit::HandShakeResponse verifyHandShakeResponse(RBKit::EvtHandshake* handShake) {
if (handShake->rbkitProtocolVersion != RBKit::AppState::getInstance()->getProtocolVersion()) {
return RBKit::HandShakeResponse::VERSION_MISMATCH;
if (handShake->rbkitProtocolVersion.toFloat() < RBKit::AppState::getInstance()->getProtocolVersion().toFloat())
{
return RBKit::HandShakeResponse::VERSION_MISMATCH_SERVER_OLD;
}
else
{
return RBKit::HandShakeResponse::VERSION_MISMATCH_CLIENT_OLD;
}
}

RBKit::AppState::getInstance()->setAppState("process_name", handShake->processName);
Expand Down
3 changes: 2 additions & 1 deletion rbkit-lib/zmqsockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ namespace RBKit
class CommandBase;
enum HandShakeResponse {
NO_RESPONSE,
VERSION_MISMATCH,
VERSION_MISMATCH_SERVER_OLD,
VERSION_MISMATCH_CLIENT_OLD,
VERSION_MATCH
};

Expand Down