MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / uwrite

Method uwrite

sshuttle/ssnet.py:219–234  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

217 return False # fullness is determined by the socket's select() state
218
219 def uwrite(self, buf):
220 if self.connect_to:
221 return 0 # still connecting
222 self.wsock.setblocking(False)
223 try:
224 return _nb_clean(self.wsock.send, buf)
225 except (OSError, socket.error):
226 _, e = sys.exc_info()[:2]
227 if e.errno == errno.EPIPE:
228 debug1('%r: uwrite: got EPIPE' % self)
229 self.nowrite()
230 return 0
231 else:
232 # unexpected error... stream is dead
233 self.seterr('uwrite: %s' % e)
234 return 0
235
236 def write(self, buf):
237 assert buf

Callers 1

writeMethod · 0.95

Calls 4

nowriteMethod · 0.95
seterrMethod · 0.95
debug1Function · 0.90
_nb_cleanFunction · 0.85

Tested by

no test coverage detected