| 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 |
| 79 virtual const std::vector<Candidate>& Candidates() const = 0; | 81 virtual const std::vector<Candidate>& Candidates() const = 0; |
| 80 | 82 |
| 81 // Sends the given packet to the given address, provided that the address is | 83 // Sends the given packet to the given address, provided that the address is |
| 82 // that of a connection or an address that has sent to us already. | 84 // that of a connection or an address that has sent to us already. |
| 83 virtual int SendTo(const void* data, size_t size, | 85 virtual int SendTo(const void* data, size_t size, |
| 84 const rtc::SocketAddress& addr, | 86 const rtc::SocketAddress& addr, |
| 85 const rtc::PacketOptions& options, bool payload) = 0; | 87 const rtc::PacketOptions& options, bool payload) = 0; |
| 86 | 88 |
| 87 // Indicates that we received a successful STUN binding request from an | 89 // Indicates that we received a successful STUN binding request from an |
| 88 // address that doesn't correspond to any current connection. To turn this | 90 // 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... |
| 123 | 125 |
| 124 virtual std::string ToString() const = 0; | 126 virtual std::string ToString() const = 0; |
| 125 | 127 |
| 126 protected: | 128 protected: |
| 127 PortInterface() {} | 129 PortInterface() {} |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace cricket | 132 } // namespace cricket |
| 131 | 133 |
| 132 #endif // WEBRTC_P2P_BASE_PORTINTERFACE_H_ | 134 #endif // WEBRTC_P2P_BASE_PORTINTERFACE_H_ |
| OLD | NEW |