mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-20 03:47:50 +01:00
Initial UDT implementation for file transfer.
New function RequestFileTransferUDT to download files from other peers.
This commit is contained in:
17
udt/duration_array.go
Normal file
17
udt/duration_array.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package udt
|
||||
|
||||
import "time"
|
||||
|
||||
type sortableDurnArray []time.Duration
|
||||
|
||||
func (a sortableDurnArray) Len() int {
|
||||
return len(a)
|
||||
}
|
||||
|
||||
func (a sortableDurnArray) Less(i, j int) bool {
|
||||
return a[i] < a[j]
|
||||
}
|
||||
|
||||
func (a sortableDurnArray) Swap(i, j int) {
|
||||
a[i], a[j] = a[j], a[i]
|
||||
}
|
||||
Reference in New Issue
Block a user