-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
As we can see here; - params string[] trackers! it's cool
public Task<SwarmSession> ConnectAsync(FileHash hash, params string[] trackers)
{
runtime.Start();
SwarmConnect connect = new SwarmConnect
{
Hash = hash,
Settings = settings,
Localhost = PeerHash.Random(),
Notifications = new NotificationCollection(),
Completion = new TaskCompletionSource<SwarmSession>(),
Peers = new HashSet<PeerHash>(),
Remotes = new HashSet<NetworkAddress>(),
Pipeline = runtime.Pipeline,
Files = runtime.Files,
Worker = runtime.Worker
};
connect.Start();
connect.Announce(trackers);
return connect.Completion.Task;
}
But in user-tool and SwarmHelper
public static async Task DownloadAsync(string destination, FileHash hash, string tracker, NotificationCallback callback)
{
using (SwarmClient client = new SwarmClient())
{
Notification notification;
SwarmSession session = await client.ConnectAsync(hash, tracker);
session.Download(destination);
while (true)
{
notification = await session.NextAsync();
callback?.Invoke(notification);
if (notification.Type == NotificationType.DataCompleted)
break;
}
}
}
string tracker (just one? too sad)
Great library, can u fix that or pull sombody (how can i pull, i am beginner)
I think it will be good update!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels