use a small timeout value initially because the server might be unreachabe
This commit is contained in:
parent
14da12921d
commit
4600eeef48
|
@ -234,11 +234,12 @@ class TcpStratumInterface(InterfaceAncestor):
|
|||
import socks
|
||||
self.s = socks.socksocket()
|
||||
self.s.setproxy(proxy_modes.index(self.proxy["mode"]), self.proxy["host"], int(self.proxy["port"]) )
|
||||
self.s.settimeout(60)
|
||||
self.s.settimeout(2)
|
||||
self.s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
|
||||
try:
|
||||
self.s.connect(( self.host.encode('ascii'), int(self.port)))
|
||||
self.is_connected = True
|
||||
self.s.settimeout(60)
|
||||
self.send([('server.version', [ELECTRUM_VERSION])])
|
||||
except:
|
||||
self.is_connected = False
|
||||
|
|
Loading…
Reference in New Issue