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

Method try_send

server.py:130–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128 self.try_send()
129
130 def try_send(self):
131 if self.tries >= 3:
132 return
133 self.tries += 1
134 self.peer = resolvconf_random_nameserver()
135 self.sock.connect((self.peer, 53))
136 debug2('DNS: sending to %r\n' % self.peer)
137 try:
138 self.sock.send(self.request)
139 except socket.error, e:
140 if e.args[0] in ssnet.NET_ERRS:
141 # might have been spurious; try again.
142 # Note: these errors sometimes are reported by recv(),
143 # and sometimes by send(). We have to catch both.
144 debug2('DNS send to %r: %s\n' % (self.peer, e))
145 self.try_send()
146 return
147 else:
148 log('DNS send to %r: %s\n' % (self.peer, e))
149 return
150
151 def callback(self):
152 try:

Callers 2

__init__Method · 0.95
callbackMethod · 0.95

Calls 4

debug2Function · 0.85
logFunction · 0.85
sendMethod · 0.80

Tested by

no test coverage detected