| 272 | self.wrap2 = wrap2 |
| 273 | |
| 274 | def pre_select(self, r, w, x): |
| 275 | if self.wrap1.shut_write: self.wrap2.noread() |
| 276 | if self.wrap2.shut_write: self.wrap1.noread() |
| 277 | |
| 278 | if self.wrap1.connect_to: |
| 279 | _add(w, self.wrap1.rsock) |
| 280 | elif self.wrap1.buf: |
| 281 | if not self.wrap2.too_full(): |
| 282 | _add(w, self.wrap2.wsock) |
| 283 | elif not self.wrap1.shut_read: |
| 284 | _add(r, self.wrap1.rsock) |
| 285 | |
| 286 | if self.wrap2.connect_to: |
| 287 | _add(w, self.wrap2.rsock) |
| 288 | elif self.wrap2.buf: |
| 289 | if not self.wrap1.too_full(): |
| 290 | _add(w, self.wrap1.wsock) |
| 291 | elif not self.wrap2.shut_read: |
| 292 | _add(r, self.wrap2.rsock) |
| 293 | |
| 294 | def callback(self): |
| 295 | self.wrap1.try_connect() |