|
CIRCT 23.0.0git
|

Classes | |
| struct | ChannelInfo |
| struct | ClientSession |
Public Member Functions | |
| Impl (Context &ctxt, int port) | |
| ~Impl () | |
| Context & | getContext () |
| void | setManifest (int esiVersion, const std::vector< uint8_t > &compressedManifest) |
| ReadChannelPort & | registerReadPort (const std::string &name, const std::string &type) |
| WriteChannelPort & | registerWritePort (const std::string &name, const std::string &type) |
| void | stop (uint32_t timeoutMS) |
| int | getPort () const |
Public Attributes | |
| utils::ReadyIdSet< uint64_t > | readyIds |
Private Types | |
| using | ChannelDirection = backends::cosim::RpcClient::ChannelDirection |
Private Member Functions | |
| void | onClientMessage (std::shared_ptr< ix::ConnectionState > state, ix::WebSocket &ws, const ix::WebSocketMessagePtr &msg) |
| void | onOpen (ix::WebSocket &ws) |
| void | onClose () |
| void | handleBinaryFrame (const std::string &data) |
| void | handleControlFrame (ix::WebSocket &ws, const std::string &text) |
| void | handleHello (ix::WebSocket &ws, uint64_t requestId, const json ¶ms) |
| void | handleSubscribe (ix::WebSocket &ws, uint64_t requestId, const json ¶ms) |
| void | handleUnsubscribe (ix::WebSocket &ws, uint64_t requestId, const json ¶ms) |
| void | sendResult (ix::WebSocket &ws, uint64_t requestId, const json &result) |
| void | sendError (ix::WebSocket &ws, uint64_t requestId, const std::string &code, const std::string &message) |
| void | transportLoop () |
Private Attributes | |
| Context & | ctxt |
| std::mutex | manifestMutex |
| std::condition_variable | manifestReadyCV |
| int | esiVersion = -1 |
| std::vector< uint8_t > | compressedManifest |
| bool | manifestReady = false |
| std::mutex | channelsMutex |
| std::map< std::string, std::unique_ptr< RpcServerReadPort > > | readPorts |
| std::map< std::string, std::unique_ptr< RpcServerWritePort > > | writePorts |
| std::unordered_map< uint64_t, ChannelInfo > | channelById |
| std::unordered_map< std::string, uint64_t > | idByName |
| uint64_t | nextChannelId = 0 |
| std::mutex | sessionMutex |
| std::unique_ptr< ClientSession > | session |
| std::thread | transportThread |
| std::unique_ptr< ix::WebSocketServer > | server |
| int | boundPort = -1 |
| ::esi::cosim::FaultStash | faultStash |
Definition at line 126 of file RpcServer.cpp.
|
private |
Definition at line 154 of file RpcServer.cpp.
| Impl::Impl | ( | Context & | ctxt, |
| int | port | ||
| ) |
Definition at line 301 of file RpcServer.cpp.
References boundPort, ctxt, esi::Context::getLogger(), esi::Logger::info(), onClientMessage(), server, transportLoop(), and transportThread.
| Impl::~Impl | ( | ) |
Definition at line 345 of file RpcServer.cpp.
References ctxt, esi::Logger::error(), esi::Context::getLogger(), server, and stop().
|
inline |
Definition at line 131 of file RpcServer.cpp.
References ctxt.
|
inline |
Definition at line 142 of file RpcServer.cpp.
References boundPort.
|
private |
Definition at line 506 of file RpcServer.cpp.
References channelById, channelsMutex, ctxt, esi::Logger::debug(), esi::Logger::error(), esi::Context::getLogger(), esi::MessageData::getSize(), and esi::cosim::parseDataFrame().
Referenced by onClientMessage().
|
private |
Definition at line 545 of file RpcServer.cpp.
References ctxt, esi::Logger::error(), faultStash, esi::Context::getLogger(), handleHello(), handleSubscribe(), handleUnsubscribe(), esi::cosim::FaultStash::record(), and sendError().
Referenced by onClientMessage().
|
private |
Definition at line 603 of file RpcServer.cpp.
References channelById, channelsMutex, compressedManifest, esiVersion, manifestMutex, manifestReady, manifestReadyCV, nextChannelId, sendResult(), session, and sessionMutex.
Referenced by handleControlFrame().
|
private |
Definition at line 652 of file RpcServer.cpp.
References channelById, channelsMutex, esi::utils::ReadyIdSet< ID >::markReady(), readyIds, sendError(), sendResult(), session, and sessionMutex.
Referenced by handleControlFrame().
|
private |
Definition at line 702 of file RpcServer.cpp.
References sendError(), sendResult(), session, and sessionMutex.
Referenced by handleControlFrame().
|
private |
Definition at line 445 of file RpcServer.cpp.
References ctxt, esi::Logger::debug(), faultStash, esi::Context::getLogger(), handleBinaryFrame(), handleControlFrame(), onClose(), esi::cosim::FaultStash::record(), session, sessionMutex, and esi::Logger::warning().
Referenced by Impl().
|
private |
Definition at line 501 of file RpcServer.cpp.
References session, and sessionMutex.
Referenced by onClientMessage().
|
private |
| ReadChannelPort & Impl::registerReadPort | ( | const std::string & | name, |
| const std::string & | type | ||
| ) |
Definition at line 377 of file RpcServer.cpp.
References channelById, channelsMutex, esi::cosim::FaultStash::check(), faultStash, idByName, nextChannelId, and readPorts.
| WriteChannelPort & Impl::registerWritePort | ( | const std::string & | name, |
| const std::string & | type | ||
| ) |
Definition at line 392 of file RpcServer.cpp.
References channelById, channelsMutex, esi::cosim::FaultStash::check(), faultStash, idByName, nextChannelId, and writePorts.
|
private |
Definition at line 739 of file RpcServer.cpp.
Referenced by handleControlFrame(), handleSubscribe(), and handleUnsubscribe().
|
private |
Definition at line 727 of file RpcServer.cpp.
Referenced by handleHello(), handleSubscribe(), and handleUnsubscribe().
| void Impl::setManifest | ( | int | esiVersion, |
| const std::vector< uint8_t > & | compressedManifest | ||
| ) |
Definition at line 365 of file RpcServer.cpp.
References esi::cosim::FaultStash::check(), compressedManifest, esiVersion, faultStash, manifestMutex, manifestReady, and manifestReadyCV.
| void Impl::stop | ( | uint32_t | timeoutMS | ) |
Definition at line 407 of file RpcServer.cpp.
References channelsMutex, esi::cosim::FaultStash::check(), faultStash, readPorts, readyIds, esi::utils::ReadyIdSet< ID >::requestShutdown(), server, session, sessionMutex, transportThread, and writePorts.
Referenced by ~Impl().
|
private |
Definition at line 752 of file RpcServer.cpp.
References esi::cosim::buildDataFrame(), channelById, channelsMutex, esi::utils::ReadyIdSet< ID >::isShutdown(), readyIds, session, sessionMutex, and esi::utils::ReadyIdSet< ID >::waitDrain().
Referenced by Impl().
|
private |
Definition at line 201 of file RpcServer.cpp.
|
private |
Definition at line 188 of file RpcServer.cpp.
Referenced by handleBinaryFrame(), handleHello(), handleSubscribe(), registerReadPort(), registerWritePort(), and transportLoop().
|
private |
Definition at line 185 of file RpcServer.cpp.
Referenced by handleBinaryFrame(), handleHello(), handleSubscribe(), registerReadPort(), registerWritePort(), stop(), and transportLoop().
|
private |
Definition at line 180 of file RpcServer.cpp.
Referenced by handleHello(), and setManifest().
|
private |
Definition at line 173 of file RpcServer.cpp.
Referenced by getContext(), handleBinaryFrame(), handleControlFrame(), Impl(), esiaccel.accelerator.AcceleratorConnection::manifest(), onClientMessage(), and ~Impl().
|
private |
Definition at line 179 of file RpcServer.cpp.
Referenced by handleHello(), and setManifest().
|
private |
Definition at line 223 of file RpcServer.cpp.
Referenced by handleControlFrame(), onClientMessage(), registerReadPort(), registerWritePort(), setManifest(), and stop().
|
private |
Definition at line 189 of file RpcServer.cpp.
Referenced by registerReadPort(), and registerWritePort().
|
private |
Definition at line 177 of file RpcServer.cpp.
Referenced by handleHello(), and setManifest().
|
private |
Definition at line 181 of file RpcServer.cpp.
Referenced by handleHello(), and setManifest().
|
private |
Definition at line 178 of file RpcServer.cpp.
Referenced by handleHello(), and setManifest().
|
private |
Definition at line 190 of file RpcServer.cpp.
Referenced by handleHello(), registerReadPort(), and registerWritePort().
|
private |
Definition at line 186 of file RpcServer.cpp.
Referenced by registerReadPort(), and stop().
| utils::ReadyIdSet<uint64_t> esi::cosim::RpcServer::Impl::readyIds |
Definition at line 148 of file RpcServer.cpp.
Referenced by handleSubscribe(), stop(), and transportLoop().
|
private |
Definition at line 200 of file RpcServer.cpp.
|
private |
Definition at line 194 of file RpcServer.cpp.
Referenced by handleHello(), handleSubscribe(), handleUnsubscribe(), onClientMessage(), onClose(), stop(), and transportLoop().
|
private |
Definition at line 193 of file RpcServer.cpp.
Referenced by handleHello(), handleSubscribe(), handleUnsubscribe(), onClientMessage(), onClose(), stop(), and transportLoop().
|
private |
Definition at line 197 of file RpcServer.cpp.
|
private |
Definition at line 187 of file RpcServer.cpp.
Referenced by registerWritePort(), and stop().