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()),
|
||||
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);
|
||||
|
||||
// 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 "pbqtio.h"
|
||||
|
||||
#include "../common/protocol.pb.h" // FIXME: temp
|
||||
|
||||
#include <qendian.h>
|
||||
|
||||
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;
|
||||
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);
|
||||
//BUFDUMP(msg, msgLen);
|
||||
#if 0
|
||||
notif = serviceStub->GetNotificationPrototype(method).New();
|
||||
#if 1
|
||||
notif = notifPrototype.New();
|
||||
#else
|
||||
notif = new OstProto::Notification;
|
||||
#endif
|
||||
|
@ -61,6 +61,7 @@ class PbRpcChannel : public QObject, public ::google::protobuf::RpcChannel
|
||||
} RpcCall;
|
||||
QList<RpcCall> pendingCallList;
|
||||
|
||||
const ::google::protobuf::Message ¬ifPrototype;
|
||||
::google::protobuf::Message *notif;
|
||||
|
||||
QHostAddress mServerAddress;
|
||||
@ -71,7 +72,8 @@ class PbRpcChannel : public QObject, public ::google::protobuf::RpcChannel
|
||||
::google::protobuf::io::CopyingOutputStreamAdaptor *outStream;
|
||||
|
||||
public:
|
||||
PbRpcChannel(QHostAddress ip, quint16 port);
|
||||
PbRpcChannel(QHostAddress ip, quint16 port,
|
||||
const ::google::protobuf::Message ¬ifProto);
|
||||
~PbRpcChannel();
|
||||
|
||||
void establish();
|
||||
|
Loading…
Reference in New Issue
Block a user