Commit a08fa1d6 authored by rna's avatar rna
Browse files

Merge branch 'develop' into feature/congestionControl

parents d44b6c69 fee56a70
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -437,6 +437,8 @@ int PrrtSocket_close(PrrtSocket *s) {
uint32_t PrrtSocket_get_sock_opt(PrrtSocket *s, const char *name) {
    if (strcmp(name, "targetdelay") == 0) {
        return PrrtApplicationConstraints_get_target_delay(s->applicationConstraints);
    } else if (strcmp(name, "connected") == 0) {
        return (s->receiver != NULL) ? 1 : 0;
    } else if (strcmp(name, "maximum_payload_size") == 0) {
        return s->maximum_payload_size;
    } else {
+1 −3
Original line number Diff line number Diff line
@@ -135,7 +135,6 @@ class PrrtCodingConfiguration:
cdef class PrrtSocket:
    cdef cprrt.PrrtSocket* _c_socket
    _epoch = datetime.datetime.utcfromtimestamp(0)
    _connected = False

    def __cinit__(self, address, maximum_payload_size = 1400, target_delay = 1, thread_pinning = False):
        host, port = address
@@ -203,10 +202,9 @@ cdef class PrrtSocket:
        host, port = address
        cdef bytes encodedHost = host.encode("utf-8")
        cprrt.PrrtSocket_connect(self._c_socket, encodedHost, port)
        self._connected = True

    def send(self, data):
        if not self._connected:
        if cprrt.PrrtSocket_get_sock_opt(self._c_socket, "connected") == 0:
            raise Exception("PrrtSocket must be connected first, before data can be sent.")
        maximum_payload_size = cprrt.PrrtSocket_get_sock_opt(self._c_socket, "maximum_payload_size")
        data_len = len(data)