#include "cast/sender/cast_platform_client.h"
#include <memory>
#include <random>
#include <string_view>
#include <utility>
#include "cast/common/channel/virtual_connection_router.h"
#include "cast/common/public/cast_socket.h"
#include "cast/common/public/receiver_info.h"
#include "util/json/json_serialization.h"
#include "util/osp_logging.h"
#include "util/stringprintf.h"
namespace openscreen::cast {
static constexpr std::chrono::seconds kRequestTimeout = …;
CastPlatformClient::CastPlatformClient(VirtualConnectionRouter& router,
ClockNowFunctionPtr clock,
TaskRunner& task_runner)
: … { … }
CastPlatformClient::~CastPlatformClient() { … }
std::optional<int> CastPlatformClient::RequestAppAvailability(
const std::string& receiver_id,
const std::string& app_id,
AppAvailabilityCallback callback) { … }
void CastPlatformClient::AddOrUpdateReceiver(const ReceiverInfo& receiver,
int socket_id) { … }
void CastPlatformClient::RemoveReceiver(const ReceiverInfo& receiver) { … }
void CastPlatformClient::CancelRequest(int request_id) { … }
void CastPlatformClient::OnMessage(VirtualConnectionRouter* router,
CastSocket* socket,
proto::CastMessage message) { … }
void CastPlatformClient::HandleResponse(const std::string& receiver_id,
int request_id,
const Json::Value& message) { … }
void CastPlatformClient::CancelAppAvailabilityRequest(int request_id) { … }
int CastPlatformClient::GetNextRequestId() { … }
int CastPlatformClient::next_request_id_ = …;
}