//
|
// Created by pansen on 2017/8/4.
|
//
|
|
#ifndef RTSPNATIVECODEC_REMOTEFUNC_H
|
#define RTSPNATIVECODEC_REMOTEFUNC_H
|
|
#include <iostream>
|
#include <capnp/ez-rpc.h>
|
#include "RemoteMethod.proto.h"
|
|
//::capnp::Capability::Server
|
template <class T> class RemoteServer{
|
public:
|
// RemoteServer(std::string host, int port, capnp::EzRpcServer rpcServer) : rpcServer(rpcServer) {
|
// this->rpcServer(kj::heap<T>(),host, port);
|
// //.rpcServer(kj::heap<T>(),host, port);
|
// };
|
RemoteServer(std::string host,int port):host(host),port(port){};
|
~RemoteServer(){};
|
|
bool start();
|
void stop();
|
bool running;
|
private:
|
std::string host;
|
int port;
|
|
static void *rServer_thd(void *arg);
|
|
pthread_t server_thd;
|
pthread_mutex_t mutexSerevr;
|
};
|
#endif //RTSPNATIVECODEC_REMOTEFUNC_H
|
|