Merge branch 'dev' into dht
[brdnet.git] / TestDHT.pas
blob55f9e7409c1305562b8eeab9dd956d801c1427be
1 unit TestDHT;
3 INTERFACE
4 IMPLEMENTATION
5 USES ServerLoop,NetAddr,SysUtils,DHT;
6 type t=object
7 procedure init;
8 end;
9 procedure t.init;
10 var oi:word;
11 const opt='-test-dht';
12 var addr:tNetAddr;
13 begin
14 oi:=OptIndex(opt);
15 if oi>0 then begin
16 assert(OptParamCount(oi)=1,opt+'(rcpt:tNetAddr fid:sha1)');
17 addr:=paramstr(oi+1);
18 writeln('TestDHT: rcpt '+paramstr(oi+1));
19 DHT.NodeBootstrap(addr);
20 end;
21 end;
23 var o:t;
24 BEGIN
25 Shedule(10,@o.init);
26 END.