Commit 25032ff6 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Connect takes address tuple.

parent bda79245
Pipeline #2228 failed with stages
in 1 minute and 8 seconds
......@@ -6,7 +6,7 @@ port = int(sys.argv[2])
localport = int(sys.argv[3])
s = prrt.PrrtSocket(("", localport))
s.connect(host, port)
s.connect((host, port))
for i in range(10):
s.send("Packet {}".format(i).encode("utf8"))
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment