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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 SocketAddress AsyncUDPSocket::GetLocalAddress() const { | 53 SocketAddress AsyncUDPSocket::GetLocalAddress() const { |
54 return socket_->GetLocalAddress(); | 54 return socket_->GetLocalAddress(); |
55 } | 55 } |
56 | 56 |
57 SocketAddress AsyncUDPSocket::GetRemoteAddress() const { | 57 SocketAddress AsyncUDPSocket::GetRemoteAddress() const { |
58 return socket_->GetRemoteAddress(); | 58 return socket_->GetRemoteAddress(); |
59 } | 59 } |
60 | 60 |
61 int AsyncUDPSocket::Send(const void *pv, size_t cb, | 61 int AsyncUDPSocket::Send(const void *pv, size_t cb, |
62 const rtc::PacketOptions& options) { | 62 const rtc::PacketOptions& options) { |
63 return socket_->Send(pv, cb); | 63 rtc::SentPacket sent_packet(options.packet_id, rtc::Time()); |
| 64 int ret = socket_->Send(pv, cb); |
| 65 SignalSentPacket(this, sent_packet); |
| 66 return ret; |
64 } | 67 } |
65 | 68 |
66 int AsyncUDPSocket::SendTo(const void *pv, size_t cb, | 69 int AsyncUDPSocket::SendTo(const void *pv, size_t cb, |
67 const SocketAddress& addr, | 70 const SocketAddress& addr, |
68 const rtc::PacketOptions& options) { | 71 const rtc::PacketOptions& options) { |
69 return socket_->SendTo(pv, cb, addr); | 72 rtc::SentPacket sent_packet(options.packet_id, rtc::Time()); |
| 73 int ret = socket_->SendTo(pv, cb, addr); |
| 74 SignalSentPacket(this, sent_packet); |
| 75 return ret; |
70 } | 76 } |
71 | 77 |
72 int AsyncUDPSocket::Close() { | 78 int AsyncUDPSocket::Close() { |
73 return socket_->Close(); | 79 return socket_->Close(); |
74 } | 80 } |
75 | 81 |
76 AsyncUDPSocket::State AsyncUDPSocket::GetState() const { | 82 AsyncUDPSocket::State AsyncUDPSocket::GetState() const { |
77 return STATE_BOUND; | 83 return STATE_BOUND; |
78 } | 84 } |
79 | 85 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // If we did not, then we should resize our buffer to be large enough. | 119 // If we did not, then we should resize our buffer to be large enough. |
114 SignalReadPacket(this, buf_, static_cast<size_t>(len), remote_addr, | 120 SignalReadPacket(this, buf_, static_cast<size_t>(len), remote_addr, |
115 CreatePacketTime(0)); | 121 CreatePacketTime(0)); |
116 } | 122 } |
117 | 123 |
118 void AsyncUDPSocket::OnWriteEvent(AsyncSocket* socket) { | 124 void AsyncUDPSocket::OnWriteEvent(AsyncSocket* socket) { |
119 SignalReadyToSend(this); | 125 SignalReadyToSend(this); |
120 } | 126 } |
121 | 127 |
122 } // namespace rtc | 128 } // namespace rtc |
OLD | NEW |