Refactoring: Cleanup RPC Channel's knowledge of notification prototype
Updates issue 144
This commit is contained in:
parent
ad6baea4af
commit
9be69a8f46
@ -57,7 +57,8 @@ PortGroup::PortGroup(QHostAddress ip, quint16 port)
|
|||||||
connect(reconnectTimer, SIGNAL(timeout()),
|
connect(reconnectTimer, SIGNAL(timeout()),
|
||||||
this, SLOT(on_reconnectTimer_timeout()));
|
this, SLOT(on_reconnectTimer_timeout()));
|
||||||
|
|
||||||
rpcChannel = new PbRpcChannel(ip, port);
|
rpcChannel = new PbRpcChannel(ip, port,
|
||||||
|
OstProto::Notification::default_instance());
|
||||||
serviceStub = new OstProto::OstService::Stub(rpcChannel);
|
serviceStub = new OstProto::OstService::Stub(rpcChannel);
|
||||||
|
|
||||||
// FIXME(LOW):Can't for my life figure out why this ain't working!
|
// FIXME(LOW):Can't for my life figure out why this ain't working!
|
||||||
|
@ -20,13 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|||||||
#include "pbrpcchannel.h"
|
#include "pbrpcchannel.h"
|
||||||
#include "pbqtio.h"
|
#include "pbqtio.h"
|
||||||
|
|
||||||
#include "../common/protocol.pb.h" // FIXME: temp
|
|
||||||
|
|
||||||
#include <qendian.h>
|
#include <qendian.h>
|
||||||
|
|
||||||
static uchar msgBuf[4096];
|
static uchar msgBuf[4096];
|
||||||
|
|
||||||
PbRpcChannel::PbRpcChannel(QHostAddress ip, quint16 port)
|
PbRpcChannel::PbRpcChannel(QHostAddress ip, quint16 port,
|
||||||
|
const ::google::protobuf::Message ¬ifProto)
|
||||||
|
: notifPrototype(notifProto)
|
||||||
{
|
{
|
||||||
isPending = false;
|
isPending = false;
|
||||||
pendingMethodId = -1; // don't care as long as isPending is false
|
pendingMethodId = -1; // don't care as long as isPending is false
|
||||||
@ -334,8 +334,8 @@ void PbRpcChannel::on_mpSocket_readyRead()
|
|||||||
{
|
{
|
||||||
//qDebug("client(%s) rcvd %d bytes", __FUNCTION__, msgLen);
|
//qDebug("client(%s) rcvd %d bytes", __FUNCTION__, msgLen);
|
||||||
//BUFDUMP(msg, msgLen);
|
//BUFDUMP(msg, msgLen);
|
||||||
#if 0
|
#if 1
|
||||||
notif = serviceStub->GetNotificationPrototype(method).New();
|
notif = notifPrototype.New();
|
||||||
#else
|
#else
|
||||||
notif = new OstProto::Notification;
|
notif = new OstProto::Notification;
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,6 +61,7 @@ class PbRpcChannel : public QObject, public ::google::protobuf::RpcChannel
|
|||||||
} RpcCall;
|
} RpcCall;
|
||||||
QList<RpcCall> pendingCallList;
|
QList<RpcCall> pendingCallList;
|
||||||
|
|
||||||
|
const ::google::protobuf::Message ¬ifPrototype;
|
||||||
::google::protobuf::Message *notif;
|
::google::protobuf::Message *notif;
|
||||||
|
|
||||||
QHostAddress mServerAddress;
|
QHostAddress mServerAddress;
|
||||||
@ -71,7 +72,8 @@ class PbRpcChannel : public QObject, public ::google::protobuf::RpcChannel
|
|||||||
::google::protobuf::io::CopyingOutputStreamAdaptor *outStream;
|
::google::protobuf::io::CopyingOutputStreamAdaptor *outStream;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PbRpcChannel(QHostAddress ip, quint16 port);
|
PbRpcChannel(QHostAddress ip, quint16 port,
|
||||||
|
const ::google::protobuf::Message ¬ifProto);
|
||||||
~PbRpcChannel();
|
~PbRpcChannel();
|
||||||
|
|
||||||
void establish();
|
void establish();
|
||||||
|
Loading…
Reference in New Issue
Block a user