(self)
| 326 | self.sock.close() |
| 327 | |
| 328 | def do_call(self): |
| 329 | call = self.packer.get_buf() |
| 330 | self.sock.send(call) |
| 331 | try: |
| 332 | from select import select |
| 333 | except ImportError: |
| 334 | print('WARNING: select not found, RPC may hang') |
| 335 | select = None |
| 336 | BUFSIZE = 8192 # Max UDP buffer size |
| 337 | timeout = 1 |
| 338 | count = 5 |
| 339 | while 1: |
| 340 | r, w, x = [self.sock], [], [] |
| 341 | if select: |
| 342 | r, w, x = select(r, w, x, timeout) |
| 343 | if self.sock not in r: |
| 344 | count = count - 1 |
| 345 | if count < 0: raise RPCError('timeout') |
| 346 | if timeout < 25: |
| 347 | timeout = timeout *2 |
| 348 | self.sock.send(call) |
| 349 | continue |
| 350 | reply = self.sock.recv(BUFSIZE) |
| 351 | u = self.unpacker |
| 352 | u.reset(reply) |
| 353 | xid, verf = u.unpack_replyheader() |
| 354 | if xid != self.lastxid: |
| 355 | continue |
| 356 | break |
| 357 | |
| 358 | |
| 359 | class RawBroadcastUDPClient(RawUDPClient): |
nothing calls this directly
no test coverage detected