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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 AppendToOutBuffer(&pkt_len, kPacketLenSize); | 289 AppendToOutBuffer(&pkt_len, kPacketLenSize); |
290 AppendToOutBuffer(pv, cb); | 290 AppendToOutBuffer(pv, cb); |
291 | 291 |
292 int res = FlushOutBuffer(); | 292 int res = FlushOutBuffer(); |
293 if (res <= 0) { | 293 if (res <= 0) { |
294 // drop packet if we made no progress | 294 // drop packet if we made no progress |
295 ClearOutBuffer(); | 295 ClearOutBuffer(); |
296 return res; | 296 return res; |
297 } | 297 } |
298 | 298 |
299 rtc::SentPacket sent_packet(options.packet_id, rtc::Time()); | 299 rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis()); |
300 SignalSentPacket(this, sent_packet); | 300 SignalSentPacket(this, sent_packet); |
301 | 301 |
302 // We claim to have sent the whole thing, even if we only sent partial | 302 // We claim to have sent the whole thing, even if we only sent partial |
303 return static_cast<int>(cb); | 303 return static_cast<int>(cb); |
304 } | 304 } |
305 | 305 |
306 void AsyncTCPSocket::ProcessInput(char * data, size_t* len) { | 306 void AsyncTCPSocket::ProcessInput(char * data, size_t* len) { |
307 SocketAddress remote_addr(GetRemoteAddress()); | 307 SocketAddress remote_addr(GetRemoteAddress()); |
308 | 308 |
309 while (true) { | 309 while (true) { |
(...skipping 12 matching lines...) Expand all Loading... |
322 memmove(data, data + kPacketLenSize + pkt_len, *len); | 322 memmove(data, data + kPacketLenSize + pkt_len, *len); |
323 } | 323 } |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 void AsyncTCPSocket::HandleIncomingConnection(AsyncSocket* socket) { | 327 void AsyncTCPSocket::HandleIncomingConnection(AsyncSocket* socket) { |
328 SignalNewConnection(this, new AsyncTCPSocket(socket, false)); | 328 SignalNewConnection(this, new AsyncTCPSocket(socket, false)); |
329 } | 329 } |
330 | 330 |
331 } // namespace rtc | 331 } // namespace rtc |
OLD | NEW |