Chromium Code Reviews| Index: webrtc/base/asyncpacketsocket.h |
| diff --git a/webrtc/base/asyncpacketsocket.h b/webrtc/base/asyncpacketsocket.h |
| index f0c221da1dec3fd4014be539224366d507fcac23..b6cd4a1b880c08f484d1385f231abc0d3cdb67b4 100644 |
| --- a/webrtc/base/asyncpacketsocket.h |
| +++ b/webrtc/base/asyncpacketsocket.h |
| @@ -34,10 +34,11 @@ struct PacketTimeUpdateParams { |
| // This structure holds meta information for the packet which is about to send |
| // over network. |
| struct PacketOptions { |
| - PacketOptions() : dscp(DSCP_NO_CHANGE) {} |
| - explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {} |
| + PacketOptions() : dscp(DSCP_NO_CHANGE), packet_id(-1) {} |
| + PacketOptions(DiffServCodePoint dscp) : dscp(dscp), packet_id(-1) {} |
| DiffServCodePoint dscp; |
| + int packet_id; // 16 bits, -1 represents "not set". |
| PacketTimeUpdateParams packet_time_params; |
| }; |
| @@ -61,6 +62,15 @@ inline PacketTime CreatePacketTime(int64 not_before) { |
| return PacketTime(TimeMicros(), not_before); |
| } |
| +struct SentPacket { |
| + SentPacket() : packet_id(-1), send_time_ms(-1) {} |
| + SentPacket(int32 packet_id, int64 send_time_ms) |
| + : packet_id(packet_id), send_time_ms(send_time_ms) {} |
| + |
| + int packet_id; |
| + int64 send_time_ms; |
| +}; |
| + |
| // Provides the ability to receive packets asynchronously. Sends are not |
| // buffered since it is acceptable to drop packets under high load. |
| class AsyncPacketSocket : public sigslot::has_slots<> { |
| @@ -109,6 +119,10 @@ class AsyncPacketSocket : public sigslot::has_slots<> { |
| const SocketAddress&, |
| const PacketTime&> SignalReadPacket; |
| + // Emitted each time a packet is sent. |
| + sigslot::signal3<AsyncPacketSocket*, const SocketAddress&, const SentPacket&> |
| + SignalPacketSent; |
|
stefan-webrtc
2015/10/05 13:43:19
I'm not sure if I actually need SocketAddress here
pthatcher1
2015/10/05 18:30:14
You shouldn't care what socket it is, as long as t
stefan-webrtc
2015/10/07 16:55:25
Acknowledged.
|
| + |
| // Emitted when the socket is currently able to send. |
| sigslot::signal1<AsyncPacketSocket*> SignalReadyToSend; |