1 #ifndef OPENTERA_WEBRTC_NATIVE_CLIENT_UTILS_FUNCTIONAL_DATA_CHANNEL_OBSERVER_H
2 #define OPENTERA_WEBRTC_NATIVE_CLIENT_UTILS_FUNCTIONAL_DATA_CHANNEL_OBSERVER_H
4 #include <OpenteraWebrtcNativeClient/Handlers/PeerConnectionHandler.h>
5 #include <OpenteraWebrtcNativeClient/Configurations/DataChannelConfiguration.h>
7 #include <api/data_channel_interface.h>
17 std::function<void(
const Client&)> m_onDataChannelOpen;
18 std::function<void(
const Client&)> m_onDataChannelClosed;
19 std::function<void(
const Client&,
const std::string&)> m_onDataChannelError;
20 std::function<void(
const Client&,
const webrtc::DataBuffer& buffer)> m_onDataChannelMessageBinary;
21 std::function<void(
const Client&,
const std::string&)> m_onDataChannelMessageString;
23 rtc::scoped_refptr<webrtc::DataChannelInterface> m_dataChannel;
25 bool m_onDataChannelClosedCalled;
33 std::function<
void(
const std::string&)> onError,
34 std::function<
void(
const Client&)> onClientConnected,
35 std::function<
void(
const Client&)> onClientDisconnected,
36 std::function<
void(
const Client&)> onClientConnectionFailed,
38 std::function<
void(
const Client&)> onDataChannelOpen,
39 std::function<
void(
const Client&)> onDataChannelClosed,
40 std::function<
void(
const Client&,
const std::string&)> onDataChannelError,
41 std::function<
void(
const Client&,
const webrtc::DataBuffer& buffer)> onDataChannelMessageBinary,
42 std::function<
void(
const Client&,
const std::string&)> onDataChannelMessageString);
46 void setPeerConnection(
const rtc::scoped_refptr<webrtc::PeerConnectionInterface>& peerConnection)
override;
48 bool send(
const webrtc::DataBuffer& buffer);
51 void OnDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel)
override;
53 void OnStateChange()
override;
54 void OnMessage(
const webrtc::DataBuffer& buffer)
override;
57 void createAnswer()
override;
Represents a peer client.
Definition: Client.h:14
Represents a data channel configuration.
Definition: DataChannelConfiguration.h:14
Definition: DataChannelPeerConnectionHandler.h:14
Definition: PeerConnectionHandler.h:36
Definition: SignalingClient.h:16