MCPcopy Index your code
hub / github.com/python/cpython / run

Method run

Lib/test/test_ssl.py:2807–2836  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2805 threading.Thread.start(self)
2806
2807 def run(self):
2808 if not self._in_context:
2809 raise ValueError(
2810 'ThreadedEchoServer must be used as a context manager')
2811 self.sock.settimeout(1.0)
2812 self.sock.listen(5)
2813 self.active = True
2814 if self.flag:
2815 # signal an event
2816 self.flag.set()
2817 while self.active:
2818 try:
2819 newconn, connaddr = self.sock.accept()
2820 if support.verbose and self.chatty:
2821 sys.stdout.write(' server: new connection from '
2822 + repr(connaddr) + '\n')
2823 handler = self.ConnectionHandler(self, newconn, connaddr)
2824 handler.start()
2825 handler.join()
2826 except TimeoutError as e:
2827 if support.verbose:
2828 sys.stdout.write(f' connection timeout {e!r}\n')
2829 except KeyboardInterrupt:
2830 self.stop()
2831 except BaseException as e:
2832 if support.verbose and self.chatty:
2833 sys.stdout.write(
2834 ' connection handling failed: ' + repr(e) + '\n')
2835
2836 self.close()
2837
2838 def close(self):
2839 if self.sock is not None:

Callers

nothing calls this directly

Calls 9

stopMethod · 0.95
closeMethod · 0.95
settimeoutMethod · 0.45
listenMethod · 0.45
setMethod · 0.45
acceptMethod · 0.45
writeMethod · 0.45
startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected