mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-23 19:19:53 +00:00
Add overridable method self.configure_socket().
Allows for setting app specific socket timeouts and other socket options.
This commit is contained in:
parent
82546d776d
commit
63b8444abe
1 changed files with 9 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue