Commit 57a3f73f authored by Philipp Hörist's avatar Philipp Hörist

TCP: Set timeout when connecting

Timeout is set to 7 seconds and reset to 0 after connecting was
successful
parent 27c4844c
Pipeline #5141 passed with stages
in 38 seconds
......@@ -38,6 +38,7 @@ class TCPConnection(Connection):
Connection.__init__(self, *args, **kwargs)
self._client = Gio.SocketClient.new()
self._client.set_timeout(7)
if self._address.proxy is not None:
self._proxy_resolver = self._address.proxy.get_resolver()
......@@ -121,6 +122,8 @@ class TCPConnection(Connection):
self._finalize('connection-failed')
return
# We use the timeout only for connecting
self._con.get_socket().set_timeout(0)
self._con.set_graceful_disconnect(True)
self._con.get_socket().set_keepalive(True)
......
Markdown is supported
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