MCPcopy Create free account
hub / github.com/catchpoint/WebPageTest.tsproxy / handle_close

Method handle_close

tsproxy.py:271–288  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

269 self.SendMessage('connected', {'success': False, 'address': self.addr})
270
271 def handle_close(self):
272 global last_client_disconnected
273 logging.info('[{0:d}] Server Connection Closed'.format(self.client_id))
274 self.state = self.STATE_ERROR
275 self.close()
276 try:
277 if self.client_id in connections:
278 if 'server' in connections[self.client_id]:
279 del connections[self.client_id]['server']
280 if 'client' in connections[self.client_id]:
281 self.SendMessage('closed', {})
282 else:
283 del connections[self.client_id]
284 if not connections:
285 last_client_disconnected = current_time()
286 logging.info('[{0:d}] Last Browser disconnected'.format(self.client_id))
287 except:
288 pass
289
290 def handle_connect(self):
291 if self.state == self.STATE_CONNECTING:

Callers 2

handle_messageMethod · 0.95
handle_writeMethod · 0.95

Calls 1

SendMessageMethod · 0.95

Tested by

no test coverage detected