Browse Source

Remove server ping counter

wip
Maurizio Porrato 12 years ago
parent
commit
1bc7c35dc0
  1. 12
      frn/protocol/server.py

12
frn/protocol/server.py

@ -28,7 +28,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
self.kp = makeRandomChallange()
self.waitingKey = False
self.pingTimer = LoopingCall(self.sendPing)
self.pingCount = 0
self.setTimeout(25.0)
def connectionLost(self, reason):
@ -57,13 +56,11 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
if self.role == 'OWNER':
self.sendAccessFlags(None)
self.sendAccessList([])
self.pingCount += 1
self.startPinging()
self.setTimeout(10.0)
return
if sline == 'P': # Pong
#log.msg('Pong')
self.pingCount -= 1
return
if sline in ['RX0', 'TX0', 'TX1']:
command, body = sline[:2], sline[2:]
@ -207,12 +204,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
self.factory.tracker.getClientProtocol(c.ID).sendAudioFrame(clientIdx, frame)
def sendPing(self):
if self.pingCount > 20:
log.msg("Client %s is dead: disconnecting" %
self.clientAddress.host)
self.transport.loseConnection()
# log.msg(self.pingCount)
self.pingCount += 1
self.transport.write(chr(0))
def sendClientList(self, clients):
@ -222,7 +213,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
self.sendLine(client.asXML(
'S','M','NN','CT','BC','ON','ID','DS'
))
self.pingCount += 1
def sendNetworkList(self, networks):
log.msg("Send network list")
@ -230,7 +220,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
self.sendLine(str(len(networks)))
for net in networks:
self.sendLine(net)
self.pingCount += 1
def sendMuteList(self, clients):
log.msg("Sending mute list to %s: %s" % (self.user.ON, str(clients)))
@ -271,7 +260,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
self.sendLine(clientId)
self.sendLine(message)
self.sendLine(target)
self.pingCount += 1
def sendAudioFrame(self, clientIdx, frame):
self.stopPinging()

Loading…
Cancel
Save