| 306 | self.wrap2 = wrap2 |
| 307 | |
| 308 | def pre_select(self, r, w, x): |
| 309 | if self.wrap1.shut_write: |
| 310 | self.wrap2.noread() |
| 311 | if self.wrap2.shut_write: |
| 312 | self.wrap1.noread() |
| 313 | |
| 314 | if self.wrap1.connect_to: |
| 315 | _add(w, self.wrap1.rsock) |
| 316 | elif self.wrap1.buf: |
| 317 | if not self.wrap2.too_full(): |
| 318 | _add(w, self.wrap2.wsock) |
| 319 | elif not self.wrap1.shut_read: |
| 320 | _add(r, self.wrap1.rsock) |
| 321 | |
| 322 | if self.wrap2.connect_to: |
| 323 | _add(w, self.wrap2.rsock) |
| 324 | elif self.wrap2.buf: |
| 325 | if not self.wrap1.too_full(): |
| 326 | _add(w, self.wrap1.wsock) |
| 327 | elif not self.wrap2.shut_read: |
| 328 | _add(r, self.wrap2.rsock) |
| 329 | |
| 330 | def callback(self, sock): |
| 331 | self.wrap1.try_connect() |