Send a pickled string to the socket. This function allows for partial sends which can happen when the network is busy.
(self, s)
| 628 | self.retryTime = now + self.retryPeriod |
| 629 | |
| 630 | def send(self, s): |
| 631 | """ |
| 632 | Send a pickled string to the socket. |
| 633 | |
| 634 | This function allows for partial sends which can happen when the |
| 635 | network is busy. |
| 636 | """ |
| 637 | if self.sock is None: |
| 638 | self.createSocket() |
| 639 | #self.sock can be None either because we haven't reached the retry |
| 640 | #time yet, or because we have reached the retry time and retried, |
| 641 | #but are still unable to connect. |
| 642 | if self.sock: |
| 643 | try: |
| 644 | self.sock.sendall(s) |
| 645 | except OSError: #pragma: no cover |
| 646 | self.sock.close() |
| 647 | self.sock = None # so we can call createSocket next time |
| 648 | |
| 649 | def makePickle(self, record): |
| 650 | """ |