These are chat archives for anacrolix/torrent

29th
Jul 2018
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 00:22

Is it possible to select files that will be downloaded? As I tested, file.setPriority(0) does not work for this purpose and it is only possible to specify by piece indexes .

For instance, to download first file:

end := firstFile.Length() / info.PieceLength
t.DownloadPieces(0, end)

but if the end value is a decimal number, I should write:

t.DownloadPieces(0, end + 1)

which means, I need to download a part of the second file.
Is there a better way to specify files that will be downloaded, without downloading the next or prior ones?

Alexander
@spawnlmg
Jul 29 2018 08:16
windows 10 Pro x64, the error is constantly written in the log
client.go:412: error accepting connection: read udp4 0.0.0.0:50721: wsarecvfrom: A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself.
client.go:412: error accepting connection: read udp4 0.0.0.0:51205: wsarecvfrom: The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.
Matt Joiner
@anacrolix
Jul 29 2018 09:52
@Nemiroff that's part of the design of BitTorrent. files can share some pieces unless they're perfectly aligned to the piece length boundaries. It's possible there's an error in the end piece calculation in File.SetPriority, the expression it's using doesn't look right. Is that something you're seeing? Completely unnecessary pieces after the file are downloaded?
Matt Joiner
@anacrolix
Jul 29 2018 09:59
@spawnlmg I'm not sure what to do about those errors. Windows returns errors on Accept and ReadFrom for UDP connections, that I don't think are actual errors. I don't have a Windows machine myself to test with.
@Nemiroff sorry that reply was meant for @ufukomer
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 10:27
@anacrolix yes, I did try it and it is downloading the file with priority 0. And I could not find any test for setPriority to see if I'm making a mistake.
Alexander
@spawnlmg
Jul 29 2018 11:28
@anacrolix Thiss error with UDP load CPU 50% and more
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 17:40
Can't I just download the files that I want to and ignore the rest. Did anyone try before?
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 17:54
@elgatito it basically sets priority. By setting priority (to 0) I can't cancel files.
Alexander
@spawnlmg
Jul 29 2018 17:55
disable UTP, problem with client.go:412: error accepting connection: read udp4 0.0.0.0:51205: wsarecvfrom: The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress.
the error disappeared
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 18:27
Okay, I'm repeating the problems with correct words. f.Download() works but it somehow start the next file even if you set the priority as 0. But anyway...
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 18:36
Screen Shot 2018-07-29 at 9.35.42 PM.png
for example, I've run Download function for file 3 and 4 then the Cancel function for the other files. But 2 and 5 were partly downloaded.
Denis
@elgatito
Jul 29 2018 19:09
anacrolix did respond to you about that
that's part of the design of BitTorrent. files can share some pieces unless they're perfectly aligned to the piece length boundaries. It's possible there's an error in the end piece calculation in File.SetPriority, the expression it's using doesn't look right. Is that something you're seeing? Completely unnecessary pieces after the file are downloaded?
Torrent consists from pieces, piece can be part of two files
So when you download file between two other files - you will get 3 files, but two of them will be downloaded a little bit
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 19:12
Yea, I see that result after his response. I understand now. Okay then. Thank you guys @elgatito @anacrolix
Denis
@elgatito
Jul 29 2018 19:13
Interesting how other libraries solve this issue
Ömer Ufuk Efendioğlu
@ufukomer
Jul 29 2018 19:15
Yea, I wonder that