// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CAST_STREAMING_PUBLIC_RPC_MESSENGER_H_ #define CAST_STREAMING_PUBLIC_RPC_MESSENGER_H_ #include <functional> #include <memory> #include <string> #include <utility> #include <vector> #include "cast/streaming/remoting.pb.h" #include "util/flat_map.h" #include "util/weak_ptr.h" namespace openscreen::cast { // Processes incoming and outgoing RPC messages and links them to desired // components on both end points. For outgoing messages, the messenger // must send an RPC message with associated handle value. On the messagee side, // the message is sent to a pre-registered component using that handle. // Before RPC communication starts, both sides need to negotiate the handle // value in the existing RPC communication channel using the special handles // |kAcquire*Handle|. // // NOTE: RpcMessenger doesn't actually send RPC messages to the remote. The // session messenger needs to set SendMessageCallback, and call // ProcessMessageFromRemote as appropriate. The RpcMessenger then distributes // each RPC message to the subscribed component. class RpcMessenger { … }; } // namespace openscreen::cast #endif // CAST_STREAMING_PUBLIC_RPC_MESSENGER_H_