summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-08-25 00:22:26 -0700
committerLance Stout <lancestout@gmail.com>2011-08-25 00:22:26 -0700
commit63b8444abe94eb2a4bc3922510a89ef0a30a0008 (patch)
tree287f3ce5f1d11b9c57eebecdac06504de7f307a3
parent82546d776da812065d234fcd785db067dc374592 (diff)
downloadslixmpp-63b8444abe94eb2a4bc3922510a89ef0a30a0008.tar.gz
slixmpp-63b8444abe94eb2a4bc3922510a89ef0a30a0008.tar.bz2
slixmpp-63b8444abe94eb2a4bc3922510a89ef0a30a0008.tar.xz
slixmpp-63b8444abe94eb2a4bc3922510a89ef0a30a0008.zip
Add overridable method self.configure_socket().
Allows for setting app specific socket timeouts and other socket options.
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 061c2951..3eb263ae 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -342,7 +342,7 @@ class XMLStream(object):
self.address = self.pick_dns_answer(self.default_domain,
self.address[1])
self.socket = self.socket_class(Socket.AF_INET, Socket.SOCK_STREAM)
- self.socket.settimeout(None)
+ self.configure_socket()
if self.reconnect_delay is None:
delay = 1.0
@@ -532,6 +532,14 @@ class XMLStream(object):
if not ignore:
self.state._set_state('connected')
+ def configure_socket(self):
+ """
+ Set timeout and other options for self.socket.
+
+ Meant to be overridden.
+ """
+ self.socket.settimeout(None)
+
def start_tls(self):
"""
Perform handshakes for TLS.