Mercurial > libervia-web
comparison src/server/server.py @ 555:db1b330c1eb1
server_side: set the connection attempt timeout to the bridge timeout (2 minutes)
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 22 Sep 2014 12:01:29 +0200 |
parents | 471b6babe960 |
children | 8a607044ecfa |
comparison
equal
deleted
inserted
replaced
554:471b6babe960 | 555:db1b330c1eb1 |
---|---|
30 from txjsonrpc.web import jsonrpc | 30 from txjsonrpc.web import jsonrpc |
31 from txjsonrpc import jsonrpclib | 31 from txjsonrpc import jsonrpclib |
32 | 32 |
33 from sat.core.log import getLogger | 33 from sat.core.log import getLogger |
34 log = getLogger(__name__) | 34 log = getLogger(__name__) |
35 from sat_frontends.bridge.DBus import DBusBridgeFrontend, BridgeExceptionNoService | 35 from sat_frontends.bridge.DBus import DBusBridgeFrontend, BridgeExceptionNoService, const_TIMEOUT as BRIDGE_TIMEOUT |
36 from sat.core.i18n import _, D_ | 36 from sat.core.i18n import _, D_ |
37 from sat.tools.xml_tools import paramsXML2XMLUI | 37 from sat.tools.xml_tools import paramsXML2XMLUI |
38 | 38 |
39 import re | 39 import re |
40 import glob | 40 import glob |
72 self.profile = None | 72 self.profile = None |
73 self.jid = None | 73 self.jid = None |
74 | 74 |
75 | 75 |
76 class LiberviaSession(server.Session): | 76 class LiberviaSession(server.Session): |
77 sessionTimeout = C.TIMEOUT | 77 sessionTimeout = C.SESSION_TIMEOUT |
78 | 78 |
79 def __init__(self, *args, **kwargs): | 79 def __init__(self, *args, **kwargs): |
80 self.__lock = False | 80 self.__lock = False |
81 server.Session.__init__(self, *args, **kwargs) | 81 server.Session.__init__(self, *args, **kwargs) |
82 | 82 |
570 """Add the given profile to the waiting list. | 570 """Add the given profile to the waiting list. |
571 | 571 |
572 @param request (server.Request): the connection request | 572 @param request (server.Request): the connection request |
573 @param profile (str): %(doc_profile)s | 573 @param profile (str): %(doc_profile)s |
574 """ | 574 """ |
575 dc = reactor.callLater(C.TIMEOUT, self.purgeRequest, profile) | 575 dc = reactor.callLater(BRIDGE_TIMEOUT, self.purgeRequest, profile) |
576 self[profile] = (request, dc) | 576 self[profile] = (request, dc) |
577 | 577 |
578 def purgeRequest(self, profile): | 578 def purgeRequest(self, profile): |
579 """Remove the given profile from the waiting list. | 579 """Remove the given profile from the waiting list. |
580 | 580 |