OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Creates a new connection to the given address. | 69 // Creates a new connection to the given address. |
70 enum CandidateOrigin { ORIGIN_THIS_PORT, ORIGIN_OTHER_PORT, ORIGIN_MESSAGE }; | 70 enum CandidateOrigin { ORIGIN_THIS_PORT, ORIGIN_OTHER_PORT, ORIGIN_MESSAGE }; |
71 virtual Connection* CreateConnection( | 71 virtual Connection* CreateConnection( |
72 const Candidate& remote_candidate, CandidateOrigin origin) = 0; | 72 const Candidate& remote_candidate, CandidateOrigin origin) = 0; |
73 | 73 |
74 // Functions on the underlying socket(s). | 74 // Functions on the underlying socket(s). |
75 virtual int SetOption(rtc::Socket::Option opt, int value) = 0; | 75 virtual int SetOption(rtc::Socket::Option opt, int value) = 0; |
76 virtual int GetOption(rtc::Socket::Option opt, int* value) = 0; | 76 virtual int GetOption(rtc::Socket::Option opt, int* value) = 0; |
77 virtual int GetError() = 0; | 77 virtual int GetError() = 0; |
78 | 78 |
79 virtual ProtocolType GetProtocol() const = 0; | |
80 | |
81 virtual const std::vector<Candidate>& Candidates() const = 0; | 79 virtual const std::vector<Candidate>& Candidates() const = 0; |
82 | 80 |
83 // Sends the given packet to the given address, provided that the address is | 81 // Sends the given packet to the given address, provided that the address is |
84 // that of a connection or an address that has sent to us already. | 82 // that of a connection or an address that has sent to us already. |
85 virtual int SendTo(const void* data, size_t size, | 83 virtual int SendTo(const void* data, size_t size, |
86 const rtc::SocketAddress& addr, | 84 const rtc::SocketAddress& addr, |
87 const rtc::PacketOptions& options, bool payload) = 0; | 85 const rtc::PacketOptions& options, bool payload) = 0; |
88 | 86 |
89 // Indicates that we received a successful STUN binding request from an | 87 // Indicates that we received a successful STUN binding request from an |
90 // address that doesn't correspond to any current connection. To turn this | 88 // address that doesn't correspond to any current connection. To turn this |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 123 |
126 virtual std::string ToString() const = 0; | 124 virtual std::string ToString() const = 0; |
127 | 125 |
128 protected: | 126 protected: |
129 PortInterface() {} | 127 PortInterface() {} |
130 }; | 128 }; |
131 | 129 |
132 } // namespace cricket | 130 } // namespace cricket |
133 | 131 |
134 #endif // WEBRTC_P2P_BASE_PORTINTERFACE_H_ | 132 #endif // WEBRTC_P2P_BASE_PORTINTERFACE_H_ |
OLD | NEW |