ctrl interface head.
[brdnet.git] / TestWatch.pas
blob717bc9ab416ebc8c7df46165b270b7d0c5e91db3
1 unit TestWatch;
3 INTERFACE
4 IMPLEMENTATION
5 uses ServerLoop,SysUtils;
7 type tObj=object
8 var f:text;
9 var h:tHandle;
10 procedure Event1(ev:Word);
11 procedure Event2;
12 procedure Init;
13 end;
15 procedure tObj.Init;
16 begin
17 assign(f,'');
18 reset(f);
19 h:=GetFileHandle(f);
20 writeln('Input handle ',h);
21 WatchFD(h,@Event1);
22 Shedule(3201,@Event2);
23 end;
25 procedure tObj.Event1(ev:Word);
26 begin
27 writeln('Event1 ',IntToHex(ev,4));
28 readln;
29 WatchFD(h,nil);
30 UnShedule(@Event2);
31 end;
32 procedure tObj.Event2;
33 begin
34 writeln('Event2 ');
35 WatchFD(h,nil);
36 end;
38 var o:tObj;
39 BEGIN
40 o.Init;
41 END.