Commits

Martin Gergov committed bea6e48

Opening and closing works, read almost..

  • Participants
  • Parent commits 645a854

Comments (0)

Files changed (2)

File udt4twisted/udt.py

         Called when my socket is ready for reading.
         """
         try:
-            print "recv from:", fd, " size:", udt.UDT_RCVDATA
-            data = udt.recvmsg(fd, udt.UDT_RCVDATA)
+            print "recv from:", fd, " size:", udt.UDT_RCVDATE
+            #FIXME
+            data = udt.recvmsg(fd, udt.UDT_RCVDATE)
             addr = self.addresses[fd]
-            #data, addr = self.socket.recvmsg(self.maxThroughput)
         except udt.UDTException as ue:
             print "!!!!"
             return

File udt4twisted/udtepollreactor.py

 
             # Update our own tracking state *only* after the epoll call has
             # succeeded.  Otherwise we may get out of sync.
-            primary[fd] = 1
+            
             if isinstance(xer, udt.Port):
                 selectables[fd.UDTSOCKET] = xer
+                primary[fd.UDTSOCKET] = 1
             else:
                 selectables[fd] = xer
+                primary[fd] = 1
 
     def addReader(self, reader):
         """
                 self._poller.modify(fd, flags)
             else:
                 flags = event
-                del selectables[fd]
+                if isinstance(xer, udt.Port):
+                    del selectables[fd.UDTSOCKET]
+                else:
+                    del selectables[fd]
                 # See comment above _control call in _add.
                 if isinstance(xer, udt.Port):
                     print "REMOVING:", fd, "With flags:", flags
                                    event)
     def _handleUDTReadSocketSet(self, set, event):
         _drdw = self._doReadOrWrite
-        #print self._selectables
         for fd in set:
             try:
                 if self.tests:
                 self._poller.add_usock(socket.UDTSOCKET,
                                        self._POLL_IN | self._POLL_DISCONNECTED)
             except KeyError:
+
+                # log.callWithLogger(selectable, _drdw, selectable,
+                #                    socket,
+                #                    event)
                 pass
             else:
-                
-                log.callWithLogger(selectable, _drdw, selectable,
-                                   socket.UDTSOCKET,
-                                   event)
                 pass
 
-        pass
 
     def _handleUDTWriteSocketSet(self, set, event):
         # _drdw = self._doReadOrWrite
         Poll the poller for new events.
         """
 
-
-
         if timeout is None:
             timeout = -1  # Wait indefinitely.