Example #1
0
        /// Start File Transfer (Accepted File)
        public static void Send(PeerSocket peer, ulong id)
        {
            FileSender fileSender = new FileSender(id);

            fileSender = (FileSender)acceptList.Search(peer, fileSender);

            // Remove From Accept and Add To The Upload List
            acceptList.Remove(peer, fileSender);
            uploadList.Add(peer, fileSender);

            // Start The File Sender
            fileSender.Start();

            // Update Num Uploads
            numUploads++;
        }
Example #2
0
        /// Start File Transfer (Send By Name)
        public static void Send(PeerSocket peer, string path)
        {
            // Create New File Sender && Update File ID
            FileSender fileSender = new FileSender(fileId++, peer, path);

            fileSender.SendedPart += new BlankEventHandler(OnSendedPart);
            fileSender.EndSend    += new ExceptionEventHandler(OnEndSend);

            // Add File Sender To The List
            uploadList.Add(peer, fileSender);

            // Start The File Sender
            fileSender.Start();

            // Update Num Uploads
            numUploads++;

            // Raise Upload Added Event
            if (Added != null)
            {
                Added(fileSender);
            }
        }