Send a pickled string to the socket. This function allows for partial sends which can happen when the network is busy.
(self, s)
| 606 | self.retryTime = now + self.retryPeriod |
| 607 | |
| 608 | def send(self, s): |
| 609 | """ |
| 610 | Send a pickled string to the socket. |
| 611 | |
| 612 | This function allows for partial sends which can happen when the |
| 613 | network is busy. |
| 614 | """ |
| 615 | if self.sock is None: |
| 616 | self.createSocket() |
| 617 | #self.sock can be None either because we haven't reached the retry |
| 618 | #time yet, or because we have reached the retry time and retried, |
| 619 | #but are still unable to connect. |
| 620 | if self.sock: |
| 621 | try: |
| 622 | self.sock.sendall(s) |
| 623 | except OSError: #pragma: no cover |
| 624 | self.sock.close() |
| 625 | self.sock = None # so we can call createSocket next time |
| 626 | |
| 627 | def makePickle(self, record): |
| 628 | """ |