Commits

Martin Gergov  committed 7e121e0

Added ttl and inorder options to udt write()

  • Participants
  • Parent commits 3e82715

Comments (0)

Files changed (1)

File udt4twisted/udt.py

             except:
                 log.err()
                 
-    def write(self, datagram, addr=None):
+    def write(self, datagram, addr=None, ttl=-1, inorder=True):
         """
         Write datagram to address.
         @type datagram: C{str}
                               DeprecationWarning, stacklevel=2)
         try:
             if self._connectedAddr:
-                self.socket.sendmsg(datagram)
+                udt.sendmsg(self.socket.UDTSOCKET, datagram, len(datagram),
+                            ttl, inorder)
                 return
             socket = [v[0] for k, v in self.addresses.iteritems() if  v[1] == addr][0]
-            return udt.sendmsg(socket, datagram, len(datagram))
+            return udt.sendmsg(socket, datagram, len(datagram), ttl, inorder)
         except KeyError:
             print "No key found!"
         except udt.UDTException as ue: