Example #1
0
def test_connect_with_default_timeout_fail():
    rsocket.setdefaulttimeout(0.1)
    s = RSocket()
    rsocket.setdefaulttimeout(None)
    assert s.gettimeout() == 0.1
    with pytest.raises(SocketTimeout):
        s.connect(INETAddress('172.30.172.30', 12345))
    s.close()
Example #2
0
def setdefaulttimeout(space, w_timeout):
    if space.is_w(w_timeout, space.w_None):
        timeout = -1.0
    else:
        timeout = space.float_w(w_timeout)
        if timeout < 0.0:
            raise oefmt(space.w_ValueError, "Timeout value out of range")
    rsocket.setdefaulttimeout(timeout)
Example #3
0
def setdefaulttimeout(space, w_timeout):
    if space.is_w(w_timeout, space.w_None):
        timeout = -1.0
    else:
        timeout = space.float_w(w_timeout)
        if timeout < 0.0:
            raise OperationError(space.w_ValueError, space.wrap("Timeout value out of range"))
    rsocket.setdefaulttimeout(timeout)
Example #4
0
def setdefaulttimeout(space, w_timeout):
    if space.is_w(w_timeout, space.w_None):
        timeout = -1.0
    else:
        timeout = space.float_w(w_timeout)
        if timeout < 0.0:
            raise OperationError(space.w_ValueError,
                                 space.wrap('Timeout value out of range'))
    rsocket.setdefaulttimeout(timeout)