Esempio n. 1
0
        public Task <PeerSession> ConnectAsync(FileHash hash, NetworkAddress remote)
        {
            runtime.Start();

            PeerConnect connect = new PeerConnect
            {
                Hash          = hash,
                Address       = remote,
                Localhost     = PeerHash.Random(),
                Notifications = new NotificationCollection(),
                Completion    = new TaskCompletionSource <PeerSession>(),
                Pipeline      = runtime.Pipeline,
                Files         = runtime.Files,
                Worker        = runtime.Worker
            };

            connect.Start();
            connect.Connect(remote);

            return(connect.Completion.Task);
        }
Esempio n. 2
0
 internal PeerSession(PeerConnect inner)
 {
     this.inner = inner;
 }