dont schedule pings if client disconnected
dont schedule pings if client disconnected
This commit is contained in:
parent
437417929e
commit
b8f95d5b9c
1 changed files with 5 additions and 4 deletions
|
|
@ -391,10 +391,11 @@ class XMPPAsyncClient:
|
||||||
xmppserverlog.exception("{}".format(e))
|
xmppserverlog.exception("{}".format(e))
|
||||||
|
|
||||||
async def send_ping(self, time):
|
async def send_ping(self, time):
|
||||||
pingstring = "<iq from='{}' to='{}' id='s2c1' type='get'><ping xmlns='urn:xmpp:ping'/></iq>".format(XMPPServer.server_id, self.bumper_jid)
|
if not self.state == 5: #disconnected
|
||||||
await self.send(pingstring)
|
pingstring = "<iq from='{}' to='{}' id='s2c1' type='get'><ping xmlns='urn:xmpp:ping'/></iq>".format(XMPPServer.server_id, self.bumper_jid)
|
||||||
await asyncio.sleep(time)
|
await self.send(pingstring)
|
||||||
pingtask = asyncio.Task(self.send_ping(time))
|
await asyncio.sleep(time)
|
||||||
|
asyncio.Task(self.send_ping(time))
|
||||||
|
|
||||||
async def _handle_result(self, xml, data):
|
async def _handle_result(self, xml, data):
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue