initial commit
[rofl0r-KOL.git] / units / indy / IdDayTimeServer.pas
blobab725b510ad637bff4c02677bcd799c4fed589b9
1 // 25-nov-2002
2 unit IdDayTimeServer;
4 interface
6 uses KOL { ,
7 Classes } ,
8 IdGlobal,
9 IdTCPServer;
11 type
12 TIdDayTimeServer = object(TIdTCPServer)
13 protected
14 FTimeZone: string;
15 function DoExecute(AThread: TIdPeerThread): boolean; override;
16 public
17 { constructor Create(AOwner: TComponent); override;
18 } { published }
19 property TimeZone: string read FTimeZone write FTimeZone;
20 property DefaultPort default IdPORT_DAYTIME;
21 end;
22 PIdDayTimeServer=^TIdDayTimeServer;
23 function NewIdDayTimeServer(AOwner: PControl):PIdDayTimeServer;
25 implementation
27 uses
28 SysUtils;
30 function NewIdDayTimeServer(AOwner: PControl):PIdDayTimeServer;
31 //constructor TIdDayTimeServer.Create(AOwner: TComponent);
32 begin
33 New( Result, Create );
34 with Result^ do
35 begin
36 // inherited;
37 DefaultPort := IdPORT_DAYTIME;
38 FTimeZone := 'EST';
39 end;
40 end;
42 function TIdDayTimeServer.DoExecute(AThread: TIdPeerThread): boolean;
43 begin
44 result := true;
45 with AThread.Connection do
46 begin
47 Writeln(FormatDateTime('dddd, mmmm dd, yyyy hh:nn:ss', Now) + '-' +
48 FTimeZone);
49 Disconnect;
50 end;
51 end;
53 end.