- Rework traffic counters

- Record the metadata bandwidth
- More null announce handling
- Callbacks for got MetaInfo event
- Cleanups
This commit is contained in:
zzz
2010-12-21 23:43:13 +00:00
parent f15b329874
commit 690aea255b
7 changed files with 129 additions and 52 deletions

View File

@@ -1004,6 +1004,30 @@ public class Snark
// System.out.println(peer.toString());
}
/**
* Called when the PeerCoordinator got the MetaInfo via magnet.
* CoordinatorListener.
* Create the storage, tell SnarkManager, and give the storage
* back to the coordinator.
*
* @throws RuntimeException via fatal()
* @since 0.8.4
*/
public void gotMetaInfo(PeerCoordinator coordinator, MetaInfo metainfo) {
meta = metainfo;
try {
storage = new Storage(_util, meta, this);
if (completeListener != null)
completeListener.gotMetaInfo(this);
coordinator.setStorage(storage);
} catch (IOException ioe) {
if (storage != null) {
try { storage.close(); } catch (IOException ioee) {}
}
fatal("Could not check or create storage", ioe);
}
}
private boolean allocating = false;
public void storageCreateFile(Storage storage, String name, long length)
{