CIRCT  19.0.0git
Public Member Functions | Private Member Functions | List of all members
esi::cosim::RpcServer Class Reference

The main RpcServer. More...

#include <CapnpThreads.h>

Inheritance diagram for esi::cosim::RpcServer:
Inheritance graph
[legend]
Collaboration diagram for esi::cosim::RpcServer:
Collaboration graph
[legend]

Public Member Functions

void run (uint16_t port)
 Start and stop the server thread. More...
 
void setManifest (unsigned int esiVersion, const std::vector< uint8_t > &manifest)
 
bool registerEndpoint (std::string epId, std::string fromHostTypeId, std::string toHostTypeId)
 
- Public Member Functions inherited from esi::cosim::CapnpCosimThread
 CapnpCosimThread ()
 
 ~CapnpCosimThread ()
 
void stop ()
 Stop the thread. More...
 
EndpointgetEndpoint (std::string epId)
 
LowLevelgetLowLevel ()
 
bool getCompressedManifest (unsigned int &esiVersion, std::vector< uint8_t > &manifest)
 

Private Member Functions

void mainLoop (uint16_t port)
 The thread's main loop function. Exits on shutdown. More...
 

Additional Inherited Members

- Protected Types inherited from esi::cosim::CapnpCosimThread
using Lock = std::lock_guard< std::mutex >
 
- Protected Member Functions inherited from esi::cosim::CapnpCosimThread
void loop (kj::WaitScope &waitScope, std::function< void()> poll)
 Start capnp polling loop. More...
 
- Protected Attributes inherited from esi::cosim::CapnpCosimThread
EndpointRegistry endpoints
 
LowLevel lowLevelBridge
 
std::thread * myThread
 
volatile bool stopSig
 
std::mutex m
 
unsigned int esiVersion = -1
 
std::vector< uint8_t > compressedManifest
 

Detailed Description

The main RpcServer.

Does not implement any capnp RPC interfaces but contains the capnp main RPC server. We run the capnp server in its own thread to be more responsive to network traffic and so as to not slow down the simulation.

Definition at line 80 of file CapnpThreads.h.

Member Function Documentation

◆ mainLoop()

void RpcServer::mainLoop ( uint16_t  port)
private

◆ registerEndpoint()

bool esi::cosim::RpcServer::registerEndpoint ( std::string  epId,
std::string  fromHostTypeId,
std::string  toHostTypeId 
)
inline

◆ run()

void RpcServer::run ( uint16_t  port)

Start and stop the server thread.

Start the server if not already started.

Definition at line 272 of file Server.cpp.

References esi::cosim::CapnpCosimThread::m, mainLoop(), and esi::cosim::CapnpCosimThread::myThread.

Referenced by sv2cCosimserverInit().

◆ setManifest()

void esi::cosim::RpcServer::setManifest ( unsigned int  esiVersion,
const std::vector< uint8_t > &  manifest 
)
inline

The documentation for this class was generated from the following files: