Example #1
0
 def sendall(self, msg, flags=0, tries=0):
     _tries = tries = int(tries)
     if tries < 0:
         raise ValueError("trie must be >= 0")
     fd = int(self)
     msg_len = len(msg)
     sent = socket.send(fd, msg, flags)
     _sent = 0
     while sent < msg_len:
         _sent = socket.send(fd, msg, flags)
         if not _sent:
             if not _tries:
                 raise IncompleteWrite(fd, sent, tries)
             _tries -= 1
         else:
             _tries = tries
         sent += _sent
Example #2
0
 def sendall(self, msg, flags=0, tries=0):
     _tries = tries = int(tries)
     if tries < 0:
         raise ValueError("trie must be >= 0")
     fd = int(self)
     msg_len = len(msg)
     sent = socket.send(fd, msg, flags)
     _sent = 0
     while sent < msg_len:
         _sent = socket.send(fd, msg, flags)
         if not _sent:
             if not _tries:
                 raise IncompleteWrite(fd, sent, tries)
             _tries -= 1
         else:
             _tries = tries
         sent += _sent
Example #3
0
 def send_to(self, msg, to, flags=0):
     return socket.send(msg, to, flags)
Example #4
0
 def send(self, msg, flags):
     return socket.send(int(self), msg, flags)
Example #5
0
 def send_to(self, msg, to, flags=0):
     return socket.send(msg, to, flags)
Example #6
0
 def send(self, msg, flags):
     return socket.send(int(self), msg, flags)