Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LARN
PRRT
Commits
25032ff6
Commit
25032ff6
authored
Apr 26, 2018
by
Andreas Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Connect takes address tuple.
parent
bda79245
Pipeline
#2228
failed with stages
in 1 minute and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
examples/sender.py
examples/sender.py
+1
-1
prrt/prrt.pyx
prrt/prrt.pyx
+2
-1
No files found.
examples/sender.py
View file @
25032ff6
...
...
@@ -6,7 +6,7 @@ port = int(sys.argv[2])
localport
=
int
(
sys
.
argv
[
3
])
s
=
prrt
.
PrrtSocket
((
"127.0.1.1"
,
localport
))
s
.
connect
(
host
,
port
)
s
.
connect
(
(
host
,
port
)
)
for
i
in
range
(
10
):
s
.
send
(
"Packet {}"
.
format
(
i
).
encode
(
"utf8"
))
...
...
prrt/prrt.pyx
View file @
25032ff6
...
...
@@ -239,7 +239,8 @@ cdef class PrrtSocket:
len
=
cprrt
.
PrrtSocket_receive_ordered_timedwait
(
self
.
_c_socket
,
<
void
*>
buffer
,
<
sockaddr
*>
&
addr
,
time_window_us
,
&
deadline_timespec
)
return
buffer
[:
len
],
sockaddr_to_addr_and_port
(
addr
)
def
connect
(
self
,
host
,
port
):
def
connect
(
self
,
address
):
host
,
port
=
address
cdef
bytes
encodedHost
=
host
.
encode
(
"utf-8"
)
cprrt
.
PrrtSocket_connect
(
self
.
_c_socket
,
encodedHost
,
port
)
...
...
Write
Preview
Markdown
is supported
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