*Update dist
This commit is contained in:
parent
d61076be57
commit
c72f45393c
|
@ -17,5 +17,6 @@ export default class DHTFlood extends EventEmitter {
|
||||||
private handleMessage;
|
private handleMessage;
|
||||||
private setupPeer;
|
private setupPeer;
|
||||||
broadcast(data: any, ttl?: number): void;
|
broadcast(data: any, ttl?: number): void;
|
||||||
|
send(peer: any, data: any, ttl?: number): void;
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=index.d.ts.map
|
//# sourceMappingURL=index.d.ts.map
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAoBlC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,KAAK,CAAM;gBAEP,EACV,OAAkB,EAClB,GAAS,EACT,aAAiB,EACjB,EAA2B,EAC3B,KAAY,GACb;;;;;;KAAK;IAkBN,OAAO,CAAC,aAAa;IAiCrB,OAAO,CAAC,SAAS;IA6CjB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,SAAW;CAcpC"}
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAoBlC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,KAAK,CAAM;gBAEP,EACV,OAAkB,EAClB,GAAS,EACT,aAAiB,EACjB,EAA2B,EAC3B,KAAY,GACb;;;;;;KAAK;IAkBN,OAAO,CAAC,aAAa;IAiCrB,OAAO,CAAC,SAAS;IA6CjB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,SAAW;IAenC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,SAAW;CAY1C"}
|
|
@ -108,5 +108,16 @@ class DHTFlood extends events_1.default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
send(peer, data, ttl = this.ttl) {
|
||||||
|
this.messageNumber++;
|
||||||
|
const { id, messageNumber } = this;
|
||||||
|
const message = this.setupPeer(peer);
|
||||||
|
message.send({
|
||||||
|
originId: id,
|
||||||
|
messageNumber,
|
||||||
|
ttl,
|
||||||
|
data: b4a_1.default.from(data),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.default = DHTFlood;
|
exports.default = DHTFlood;
|
||||||
|
|
Loading…
Reference in New Issue