(self, connection)
| 734 | self.forksession(self.sock.accept()) |
| 735 | |
| 736 | def forksession(self, connection): |
| 737 | # Like session but forks off a subprocess |
| 738 | import os |
| 739 | # Wait for deceased children |
| 740 | try: |
| 741 | while 1: |
| 742 | pid, sts = os.waitpid(0, 1) |
| 743 | except os.error: |
| 744 | pass |
| 745 | pid = None |
| 746 | try: |
| 747 | pid = os.fork() |
| 748 | if pid: # Parent |
| 749 | connection[0].close() |
| 750 | return |
| 751 | # Child |
| 752 | self.session(connection) |
| 753 | finally: |
| 754 | # Make sure we don't fall through in the parent |
| 755 | if pid == 0: |
| 756 | os._exit(0) |
| 757 | |
| 758 | |
| 759 | class UDPServer(Server): |
no test coverage detected