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
25032ff6
Commit
25032ff6
authored
Apr 26, 2018
by
Andreas Schmidt
Browse files
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
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
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