ttorrent icon indicating copy to clipboard operation
ttorrent copied to clipboard

fd leak - closing channel unable to be used but already given fd by OS

Open zanella opened this issue 9 years ago • 0 comments

This bug can be seen if you "open" more than 1 client locally, since the trying for bind() always goes from PORT_RANGE_START to PORT_RANGE_END the number of leaked file descriptors (socket, TCP) can be determined by the summation of (i - 1) for i in N:

for (int i = 1; i <= N; i++) { sum += i - 1; }

To get a high throughput I'm creating a lot of seeder clients, so I exhausted the number of fds rather quickly, heh.

zanella avatar Oct 05 '16 14:10 zanella