Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
udp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Roc Streaming authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_packet/target_libuv/roc_packet/udp.h
10//! @brief UDP packet.
11
12#ifndef ROC_PACKET_UDP_H_
13#define ROC_PACKET_UDP_H_
14
15#include <uv.h>
16
18#include "roc_core/slice.h"
19#include "roc_core/stddefs.h"
20#include "roc_core/time.h"
21
22namespace roc {
23namespace packet {
24
25//! UDP packet.
26struct UDP {
27 //! Source address.
28 //! @remarks
29 //! Address from which packet was / will be sent.
31
32 //! Destination address.
33 //! @remarks
34 //! Address to which packet was / will be sent.
36
37 //! Packet receive timestamp (RTS), nanoseconds since Unix epoch.
38 //! @remarks
39 //! It points to a moment when packets was grabbed by network thread.
41
42 //! Packet queue timestamp (QTS), nanoseconds since Unix epoch.
43 //! @remarks
44 //! It points to a moment when the packet was transferred to a sink-thread,
45 //! that "consumes" this packet. The reason to have it separate is that this
46 //! allows us to account additional jitter introduced by thread-switch time.
48
49 //! Sender request state.
50 //! @remarks
51 //! Used by network thread.
52 uv_udp_send_t request;
53
54 UDP();
55};
56
57} // namespace packet
58} // namespace roc
59
60#endif // ROC_PACKET_UDP_H_
int64_t nanoseconds_t
Nanoseconds.
Definition time.h:58
Root namespace.
Slice.
Socket address.
Commonly used types and functions.
UDP packet.
Definition udp.h:26
address::SocketAddr src_addr
Source address.
Definition udp.h:30
uv_udp_send_t request
Sender request state.
Definition udp.h:52
core::nanoseconds_t queue_timestamp
Packet queue timestamp (QTS), nanoseconds since Unix epoch.
Definition udp.h:47
core::nanoseconds_t receive_timestamp
Packet receive timestamp (RTS), nanoseconds since Unix epoch.
Definition udp.h:40
address::SocketAddr dst_addr
Destination address.
Definition udp.h:35
Time definitions.