Recently learned P2P knowledge, so there is an impulse of the source code of P2P software!
Oh, in fact, I see two reasons for Azureus. First, he is written by Java, and emule is written by C , I am not very familiar with C ,
I am afraid that I have no Azureus understanding, the second is to see the analysis of the CRMKY's blog has an analysis of Azureus. He said that it is good, Well, then
瞧! ,Ha ha
CRMKY's evaluation of Azureus is as follows:
Read the Azureus source code Because the company's P2P framework is to be architect, you want to read the existing Java P2P software code to see what is available. One is worth learning from Azureus, very successful BT download software, and how much the functions we have to achieve, can be said to be BT streaming media version :). There are still some interesting things during the Azureus code, some friends say not to see the Azureus code, saying is very poor; we also say that there is too many interfabs in Azureus, he doesn't like ... but I have seen some Discover that Azureus code is very good. Interface is not much, it is too close to the implementation, a thousand lines of code that realizes the ocean sprinkle, if there is no interfab definition, I estimate that I will see. It's not that there is no problem in the Azureus code, but I believe that the friend who said that Azureus code written does not carefully read its code, in turn is good, I have learned from its code :) I mainly It is org.Gudy.azureus2.core3 package, and the Plugin package and ui package I ignore it, and mainly study their architecture, and the implementation is not fine. Org.Gudy.azureus2.core3 The next level of the package is listed below:
Category, classification management, reflecting a row of buttons displayed on the upper right corner on the interface, you can manage all configuration information in memory, configure management, and runtime maintenance of memory in different categories, and persistent DISK, disk management, Perform asynchronous or synchronous I / O requests Download, download management, each BT download corresponding one of the DownloadManager Global, global management, managing all BT downloads, managing all DownloadManager HTML, HTML Download and Analyze, seems to be mainly used to determine if the software is Need to update INTERNAT, internationalize IPChecker, check IP, it seems to be mainly used to determine the external IP address IPFILTER, IP filtering, and the log processing Peer, Node management, BT download is from multiple nodes, and BT download is from multiple nodes. Download SECURITY. Safety management, use SSL encryption to ensure security Stats, statistical management, record statistics into disk Torrent, Torrent file parsing TorrentDownloader, Torrent seed file download, reflecting on the interface -> Open -> URL, from the network Download directly on the hard drive, with BT Tracker UTIL, Tools XML, XML Processing Related Tools Recommended Read Sequence Azureus documentation is not recommended to understand what the Azureus architecture and code are understood. My personal opinion is to look at the Util package. After doing understanding, you can read the Global package, then look at the Download Pack, then read the rest of the relevant package. Because Azureus's structure is a GlobalManager manages multiple DownloadManager, each DownloadManager is associated with a DiskManager, a PeerManager. Highlight Util.SystemTime, read system time with standalone thread, and determine if the system time is turned back to record. However, it is only recorded in the log, and has not been processed. It can be considered to expand this class to ensure that the system time has increased forward since the program starts. (Otherwise, in terms of average speed calculation, due to time callbacks may result in some abnormal occurs) Util.average, the average speed is asked. Util.debug, when logging a log, you can get this class, you can throw an exception and capture the exception to get the call sequence. Util.directBytebufferPool, run OutofMemoryError, do some memory cleanup, such as removing some cache, if no longer, throw an exception; initialize all Key / Value in the map (Value is a collection), this is running When the MAP is read-only, you can use it in synchronous access. (Changed only in MAP Value Collection) DISK, the package implements the I / O operation queue, can be performed in an asynchronous manner, so you can put all I / O operations in a thread. For example, a write request can be added to a write queue, and an event notification is made when writing is completed.