Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits: 57a3f73f by lovetox at 2020-03-17T16:47:32+01:00 TCP: Set timeout when connecting
Timeout is set to 7 seconds and reset to 0 after connecting was successful
- - - - -
1 changed file:
- nbxmpp/tcp.py
Changes:
===================================== nbxmpp/tcp.py ===================================== @@ -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)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/57a3f73f6c0d71d73f2efafb8...