OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 virtual int GetError(); | 88 virtual int GetError(); |
89 | 89 |
90 virtual bool HandleIncomingPacket( | 90 virtual bool HandleIncomingPacket( |
91 rtc::AsyncPacketSocket* socket, const char* data, size_t size, | 91 rtc::AsyncPacketSocket* socket, const char* data, size_t size, |
92 const rtc::SocketAddress& remote_addr, | 92 const rtc::SocketAddress& remote_addr, |
93 const rtc::PacketTime& packet_time) { | 93 const rtc::PacketTime& packet_time) { |
94 // All packets given to UDP port will be consumed. | 94 // All packets given to UDP port will be consumed. |
95 OnReadPacket(socket, data, size, remote_addr, packet_time); | 95 OnReadPacket(socket, data, size, remote_addr, packet_time); |
96 return true; | 96 return true; |
97 } | 97 } |
| 98 virtual bool SupportsProtocol(const std::string& protocol) const { |
| 99 return protocol == UDP_PROTOCOL_NAME; |
| 100 } |
98 | 101 |
99 void set_stun_keepalive_delay(int delay) { | 102 void set_stun_keepalive_delay(int delay) { |
100 stun_keepalive_delay_ = delay; | 103 stun_keepalive_delay_ = delay; |
101 } | 104 } |
102 int stun_keepalive_delay() const { | 105 int stun_keepalive_delay() const { |
103 return stun_keepalive_delay_; | 106 return stun_keepalive_delay_; |
104 } | 107 } |
105 | 108 |
106 protected: | 109 protected: |
107 UDPPort(rtc::Thread* thread, | 110 UDPPort(rtc::Thread* thread, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 false) { | 277 false) { |
275 // UDPPort will set these to local udp, updating these to STUN. | 278 // UDPPort will set these to local udp, updating these to STUN. |
276 set_type(STUN_PORT_TYPE); | 279 set_type(STUN_PORT_TYPE); |
277 set_server_addresses(servers); | 280 set_server_addresses(servers); |
278 } | 281 } |
279 }; | 282 }; |
280 | 283 |
281 } // namespace cricket | 284 } // namespace cricket |
282 | 285 |
283 #endif // WEBRTC_P2P_BASE_STUNPORT_H_ | 286 #endif // WEBRTC_P2P_BASE_STUNPORT_H_ |
OLD | NEW |