Closed GoogleCodeExporter closed 9 years ago
Original comment by voiprese...@gmail.com
on 7 Feb 2011 at 4:44
Hmmm... this fix does not really fix the problem completely.
The OS command (on Mac: sudo lsof -i -P | grep -i Python) still shows that the
sockets are not freed for RTP/RTCP.
It seems like multitask.py related issue. If I replace both multitask.recvfrom
related code (and next line) from receiveRTP and receiveRTCP with
multitask.sleep(0.05), then it can work in cleaning up the sockets. So looks
like if multitask gets hold of the socket, it never gets freed easily. I
checked that all open sockets are calling close() correctly, but still the OS
shows them as not closed.
Original comment by voiprese...@gmail.com
on 7 Feb 2011 at 4:46
Fixed in rtmplite svn r43 and p2p-sip svn r27
In std/rfc3550.py cleanup rtp/rtcp socket by explicitly closing file descriptor.
In multitask.py do not enqueue exception when removing bad descriptors.
The problem was that once an UDP socket goes to multitask.recvfrom, it never
gets closed unless you explicitly close the underlying file descriptor using
os.close(sock.fileno()). BUT. sock.fileno() becomes invalid after sock.close().
AND. multitask throws an exception if underlying file descriptor is closed. The
fix changes multitask to not throw that exception when removing bad file
descriptors. And changes RTP rfc3550.py to close underlying file descriptor
after the receiving tasks terminate.
Original comment by voiprese...@gmail.com
on 8 Feb 2011 at 6:47
The attached file shows the problem and the solution.
If you comment out os.close(fn) then on Mac OS X your command
$ sudo lsof -i -P | grep -i Python
will show the open socket port even after it is closed using s.close().
With os.close(fn), the command does not show open socket port any more.
Original comment by voiprese...@gmail.com
on 8 Feb 2011 at 6:50
Attachments:
Original issue reported on code.google.com by
voiprese...@gmail.com
on 7 Feb 2011 at 4:43