/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: AuRPCServer.hpp Date: 2022-6-29 Author: Reece ***/ #pragma once struct AuRPCRequest; struct AuRPCServerChannel; struct AuRPCServer : AuIRPCServer { bool Init(AuRPC* parent, AuAsync::WorkerPId_t worker); bool RegisterService(const AuSPtr service) override; AuString ExportString() override; AuSPtr ToPrimaryChannel(); AuSPtr NewChannel(); void Dispatch(AuRPCServerChannel *channel, const AuSPtr &request, AuByteBuffer *buffer); private: AuRPC* parent; AuSPtr channel; AuAsync::WorkerPId_t worker; AuThreadPrimitives::RWLockUnique_t lock; AuHashMap> serviceTable; };