Remove server ping counter
This commit is contained in:
parent
0625631aae
commit
1bc7c35dc0
|
@ -28,7 +28,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
|
||||||
self.kp = makeRandomChallange()
|
self.kp = makeRandomChallange()
|
||||||
self.waitingKey = False
|
self.waitingKey = False
|
||||||
self.pingTimer = LoopingCall(self.sendPing)
|
self.pingTimer = LoopingCall(self.sendPing)
|
||||||
self.pingCount = 0
|
|
||||||
self.setTimeout(25.0)
|
self.setTimeout(25.0)
|
||||||
|
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
|
@ -57,13 +56,11 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
|
||||||
if self.role == 'OWNER':
|
if self.role == 'OWNER':
|
||||||
self.sendAccessFlags(None)
|
self.sendAccessFlags(None)
|
||||||
self.sendAccessList([])
|
self.sendAccessList([])
|
||||||
self.pingCount += 1
|
|
||||||
self.startPinging()
|
self.startPinging()
|
||||||
self.setTimeout(10.0)
|
self.setTimeout(10.0)
|
||||||
return
|
return
|
||||||
if sline == 'P': # Pong
|
if sline == 'P': # Pong
|
||||||
#log.msg('Pong')
|
#log.msg('Pong')
|
||||||
self.pingCount -= 1
|
|
||||||
return
|
return
|
||||||
if sline in ['RX0', 'TX0', 'TX1']:
|
if sline in ['RX0', 'TX0', 'TX1']:
|
||||||
command, body = sline[:2], sline[2:]
|
command, body = sline[:2], sline[2:]
|
||||||
|
@ -207,12 +204,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
|
||||||
self.factory.tracker.getClientProtocol(c.ID).sendAudioFrame(clientIdx, frame)
|
self.factory.tracker.getClientProtocol(c.ID).sendAudioFrame(clientIdx, frame)
|
||||||
|
|
||||||
def sendPing(self):
|
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))
|
self.transport.write(chr(0))
|
||||||
|
|
||||||
def sendClientList(self, clients):
|
def sendClientList(self, clients):
|
||||||
|
@ -222,7 +213,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
|
||||||
self.sendLine(client.asXML(
|
self.sendLine(client.asXML(
|
||||||
'S','M','NN','CT','BC','ON','ID','DS'
|
'S','M','NN','CT','BC','ON','ID','DS'
|
||||||
))
|
))
|
||||||
self.pingCount += 1
|
|
||||||
|
|
||||||
def sendNetworkList(self, networks):
|
def sendNetworkList(self, networks):
|
||||||
log.msg("Send network list")
|
log.msg("Send network list")
|
||||||
|
@ -230,7 +220,6 @@ class FRNServer(BufferingLineReceiver, TimeoutMixin):
|
||||||
self.sendLine(str(len(networks)))
|
self.sendLine(str(len(networks)))
|
||||||
for net in networks:
|
for net in networks:
|
||||||
self.sendLine(net)
|
self.sendLine(net)
|
||||||
self.pingCount += 1
|
|
||||||
|
|
||||||
def sendMuteList(self, clients):
|
def sendMuteList(self, clients):
|
||||||
log.msg("Sending mute list to %s: %s" % (self.user.ON, str(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(clientId)
|
||||||
self.sendLine(message)
|
self.sendLine(message)
|
||||||
self.sendLine(target)
|
self.sendLine(target)
|
||||||
self.pingCount += 1
|
|
||||||
|
|
||||||
def sendAudioFrame(self, clientIdx, frame):
|
def sendAudioFrame(self, clientIdx, frame):
|
||||||
self.stopPinging()
|
self.stopPinging()
|
||||||
|
|
Loading…
Reference in New Issue