- Ostinato Client - will start the server as a child process at startup and terminate it at exit - Ostinato Server (Drone) - is now a system tray application - if not able to bind to a IP/Port successfully, informs the user and exits - the GUI is now nothing more than a TextLabel Others - If a getStats() request is pending, the client will not queue up any more requests till a reply is received for the pending one - Nitpicks in the Payload protocol Widget, PortsWindow Widget
45 lines
936 B
C++
45 lines
936 B
C++
#ifndef _RPC_SERVER_H
|
|
#define _RPC_SERVER_H
|
|
|
|
#include <google/protobuf/message.h>
|
|
#include <google/protobuf/descriptor.h>
|
|
#include <google/protobuf/service.h>
|
|
|
|
#include <QTcpServer>
|
|
#include <QTcpSocket>
|
|
|
|
#include "pbrpccommon.h"
|
|
#include "pbrpccontroller.h"
|
|
|
|
|
|
class RpcServer : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
QTcpServer *server;
|
|
QTcpSocket *clientSock;
|
|
|
|
::google::protobuf::Service *service;
|
|
|
|
bool isPending;
|
|
int pendingMethodId;
|
|
QString errorString_;
|
|
|
|
public:
|
|
RpcServer(); //! \todo (LOW) use 'parent' param
|
|
virtual ~RpcServer();
|
|
|
|
bool registerService(::google::protobuf::Service *service,
|
|
quint16 tcpPortNum);
|
|
QString errorString();
|
|
void done(::google::protobuf::Message *resp, PbRpcController *controller);
|
|
|
|
private slots:
|
|
void when_newConnection();
|
|
void when_disconnected();
|
|
void when_dataAvail();
|
|
void when_error(QAbstractSocket::SocketError socketError);
|
|
};
|
|
|
|
#endif
|