| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // clients can send to. It may take some time before the address is ready. | 59 // clients can send to. It may take some time before the address is ready. |
| 60 // Once it is ready, we will send SignalAddressReady. If errors are | 60 // Once it is ready, we will send SignalAddressReady. If errors are |
| 61 // preventing the port from getting an address, it may send | 61 // preventing the port from getting an address, it may send |
| 62 // SignalAddressError. | 62 // SignalAddressError. |
| 63 virtual void PrepareAddress() = 0; | 63 virtual void PrepareAddress() = 0; |
| 64 | 64 |
| 65 // Returns the connection to the given address or NULL if none exists. | 65 // Returns the connection to the given address or NULL if none exists. |
| 66 virtual Connection* GetConnection( | 66 virtual Connection* GetConnection( |
| 67 const rtc::SocketAddress& remote_addr) = 0; | 67 const rtc::SocketAddress& remote_addr) = 0; |
| 68 | 68 |
| 69 // Creates a new connection to the given address. | 69 // Creates a new connection to the given address with the given ICE config. |
| 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(const Candidate& remote_candidate, |
| 72 const Candidate& remote_candidate, CandidateOrigin origin) = 0; | 72 CandidateOrigin origin, |
| 73 const IceConfig& config) = 0; |
| 73 | 74 |
| 74 // Functions on the underlying socket(s). | 75 // Functions on the underlying socket(s). |
| 75 virtual int SetOption(rtc::Socket::Option opt, int value) = 0; | 76 virtual int SetOption(rtc::Socket::Option opt, int value) = 0; |
| 76 virtual int GetOption(rtc::Socket::Option opt, int* value) = 0; | 77 virtual int GetOption(rtc::Socket::Option opt, int* value) = 0; |
| 77 virtual int GetError() = 0; | 78 virtual int GetError() = 0; |
| 78 | 79 |
| 79 virtual const std::vector<Candidate>& Candidates() const = 0; | 80 virtual const std::vector<Candidate>& Candidates() const = 0; |
| 80 | 81 |
| 81 // Sends the given packet to the given address, provided that the address is | 82 // 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. | 83 // that of a connection or an address that has sent to us already. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 124 |
| 124 virtual std::string ToString() const = 0; | 125 virtual std::string ToString() const = 0; |
| 125 | 126 |
| 126 protected: | 127 protected: |
| 127 PortInterface() {} | 128 PortInterface() {} |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 } // namespace cricket | 131 } // namespace cricket |
| 131 | 132 |
| 132 #endif // WEBRTC_P2P_BASE_PORTINTERFACE_H_ | 133 #endif // WEBRTC_P2P_BASE_PORTINTERFACE_H_ |
| OLD | NEW |