MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / pre_select

Method pre_select

ssnet.py:274–292  ·  view source on GitHub ↗
(self, r, w, x)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 3

_addFunction · 0.85
noreadMethod · 0.45
too_fullMethod · 0.45

Tested by

no test coverage detected