summary refs log tree commit diff
path: root/src/rpcStub.cpp
blob: 3d84892405c5605163b83761c69050650bce039c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "rpcStub.hpp"

class fossCordInternalsImpl final : public fosscordMedia::fosscordInternals::Service{
	grpc::Status sendRequest(
		grpc::ServerContext* ctx,
		const fosscordMedia::rpcRequest* req,
		fosscordMedia::rpcResponse* resp
	) override{
		resp->set_b(333);
		return grpc::Status::OK;
	}

};

rpcStub::rpcStub(int port){
	grpc::ServerBuilder builder;

	fossCordInternalsImpl* service;
	builder.AddListeningPort("0.0.0.0:8057", grpc::InsecureServerCredentials() );
	builder.RegisterService(service);

	std::unique_ptr<grpc::Server> server(builder.BuildAndStart());
	std::cout << "Server listening on port 8057 " << std::endl;
}