OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_PEER_CONNECTION_CLIENT_H_ | 11 #ifndef WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_PEER_CONNECTION_CLIENT_H_ |
12 #define WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_PEER_CONNECTION_CLIENT_H_ | 12 #define WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_PEER_CONNECTION_CLIENT_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 | 17 |
18 #include "webrtc/rtc_base/messagehandler.h" | 18 #include "webrtc/base/messagehandler.h" |
19 #include "webrtc/rtc_base/nethelpers.h" | 19 #include "webrtc/base/nethelpers.h" |
20 #include "webrtc/rtc_base/physicalsocketserver.h" | 20 #include "webrtc/base/physicalsocketserver.h" |
21 #include "webrtc/rtc_base/sigslot.h" | 21 #include "webrtc/base/sigslot.h" |
22 | 22 |
23 typedef std::map<int, std::string> Peers; | 23 typedef std::map<int, std::string> Peers; |
24 | 24 |
25 struct PeerConnectionClientObserver { | 25 struct PeerConnectionClientObserver { |
26 virtual void OnSignedIn() = 0; // Called when we're logged on. | 26 virtual void OnSignedIn() = 0; // Called when we're logged on. |
27 virtual void OnDisconnected() = 0; | 27 virtual void OnDisconnected() = 0; |
28 virtual void OnPeerConnected(int id, const std::string& name) = 0; | 28 virtual void OnPeerConnected(int id, const std::string& name) = 0; |
29 virtual void OnPeerDisconnected(int peer_id) = 0; | 29 virtual void OnPeerDisconnected(int peer_id) = 0; |
30 virtual void OnMessageFromPeer(int peer_id, const std::string& message) = 0; | 30 virtual void OnMessageFromPeer(int peer_id, const std::string& message) = 0; |
31 virtual void OnMessageSent(int err) = 0; | 31 virtual void OnMessageSent(int err) = 0; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 std::string onconnect_data_; | 113 std::string onconnect_data_; |
114 std::string control_data_; | 114 std::string control_data_; |
115 std::string notification_data_; | 115 std::string notification_data_; |
116 std::string client_name_; | 116 std::string client_name_; |
117 Peers peers_; | 117 Peers peers_; |
118 State state_; | 118 State state_; |
119 int my_id_; | 119 int my_id_; |
120 }; | 120 }; |
121 | 121 |
122 #endif // WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_PEER_CONNECTION_CLIENT_H_ | 122 #endif // WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_PEER_CONNECTION_CLIENT_H_ |
OLD | NEW |