Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
PRRT
Commits
1d7c9d8b
Commit
1d7c9d8b
authored
Oct 02, 2020
by
Marlene Böhmer
Browse files
enable pacing
parent
5c333cee
Pipeline
#4618
failed with stages
in 1 minute and 33 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
prrt/proto/socket.c
View file @
1d7c9d8b
...
...
@@ -83,7 +83,7 @@ PrrtSocket *PrrtSocket_create(prrtByteCount_t maximum_payload_size, prrtTimedelt
check_mem
(
s
);
s
->
nextSendTime
=
0
;
s
->
pacingEnabled
=
fals
e
;
s
->
pacingEnabled
=
tru
e
;
s
->
maximum_payload_size
=
maximum_payload_size
;
s
->
isHardwareTimestamping
=
false
;
s
->
interfaceName
=
NULL
;
...
...
prrt/prrt.pyx
View file @
1d7c9d8b
...
...
@@ -173,10 +173,11 @@ cdef class PrrtSocket:
cdef
cprrt
.
PrrtSocket
*
_c_socket
_epoch
=
datetime
.
datetime
.
utcfromtimestamp
(
0
)
def
__cinit__
(
self
,
address
,
maximum_payload_size
=
1400
,
target_delay
=
1
,
thread_pinning
=
False
,
hardware_timestamping_interface
=
None
):
def
__cinit__
(
self
,
address
,
maximum_payload_size
=
1400
,
target_delay
=
1
,
thread_pinning
=
False
,
hardware_timestamping_interface
=
None
,
pacing
=
True
):
host
,
port
=
address
target_delay_us
=
target_delay
*
1000
**
2
self
.
_c_socket
=
cprrt
.
PrrtSocket_create
(
maximum_payload_size
,
target_delay_us
)
cprrt
.
PrrtSocket_set_sock_opt
(
self
.
_c_socket
,
"pacing_enabled"
,
pacing
)
if
thread_pinning
:
cprrt
.
PrrtSocket_enable_thread_pinning
(
self
.
_c_socket
)
if
hardware_timestamping_interface
is
not
None
:
...
...
@@ -224,6 +225,10 @@ cdef class PrrtSocket:
return
cprrt
.
PrrtSocket_get_sock_opt
(
self
.
_c_socket
,
"maximum_payload_size"
)
# Pacing
property
pacing
:
def
__get__
(
self
):
return
cprrt
.
PrrtSocket_get_sock_opt
(
self
.
_c_socket
,
"pacing_enabled"
)
property
paces
:
def
__get__
(
self
):
appSend
=
PrrtPace
(
cprrt
.
PrrtSocket_get_sock_opt
(
self
.
_c_socket
,
"appSend_pace_internal"
)
*
0.000001
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment