(self)
| 192 | self.start() |
| 193 | |
| 194 | def start(self): |
| 195 | assert not self._started |
| 196 | self._started = True |
| 197 | |
| 198 | up_read, up_write = os.pipe() |
| 199 | down_read, down_write = os.pipe() |
| 200 | args, sock = self.args, self.sock |
| 201 | |
| 202 | pid = os.fork() |
| 203 | if pid: |
| 204 | # parent |
| 205 | os.close(up_read) |
| 206 | os.close(down_write) |
| 207 | asyncio.async(self.connect(pid, up_write, down_read)) |
| 208 | else: |
| 209 | # child |
| 210 | os.close(up_write) |
| 211 | os.close(down_read) |
| 212 | |
| 213 | # cleanup after fork |
| 214 | asyncio.set_event_loop(None) |
| 215 | |
| 216 | # setup process |
| 217 | process = ChildProcess(up_read, down_write, args, sock) |
| 218 | process.start() |
| 219 | |
| 220 | @asyncio.coroutine |
| 221 | def heartbeat(self, writer): |
no test coverage detected