Implement remote procedure calls.

This commit is contained in:
Peter Johnson
2015-08-13 13:12:15 -07:00
parent e199e3571b
commit 8d7cdeabbf
13 changed files with 892 additions and 261 deletions

View File

@@ -81,24 +81,7 @@ class DispatcherBase {
// Mutex for user-accessible items
mutable std::mutex m_user_mutex;
struct Connection {
Connection() = default;
explicit Connection(std::unique_ptr<NetworkConnection> net_)
: net(std::move(net_)) {}
Connection(Connection&& rhs) {
net = std::move(rhs.net);
outgoing = std::move(rhs.outgoing);
last_update = std::move(rhs.last_update);
}
Connection(const Connection&) = delete;
Connection& operator=(const Connection&) = delete;
void QueueOutgoing(std::shared_ptr<Message> msg);
std::unique_ptr<NetworkConnection> net;
NetworkConnection::Outgoing outgoing;
std::vector<std::pair<std::size_t, std::size_t>> last_update;
};
std::vector<Connection> m_connections;
std::vector<std::shared_ptr<NetworkConnection>> m_connections;
std::string m_identity;
std::atomic_bool m_active; // set to false to terminate threads