Skip to content

Sould i send trackers? #6

@ASlepushko

Description

@ASlepushko
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;
        }

there

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;
                }
            }
        }

there

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions