Hello Peter,

Thanks for your feedback. While you are at it, maybe you could fix the issues you see and propose it to the community ? Before doing that, be sure to download the very latest development snapshot, preferably directly out of the SVN repository. Then make your changes and submit a SVN diff file.

Regards,
--
francois.pie...@overbyte.be

Sure

Just an other question.
Sample from Memo output:
   TimeStamp        = 2011-11-11T11:45:48.000+01:00
   DateTime         = 2011-11-11 11:45:48.000

Shouldnt DecodedMessage.Hour be corrected by DecodedMessage.TZBias ?

Checked out latest SVN today. Revision 818.

In case attachment does not go through.

OverbyteIcsSysLogServer.diff:
--- C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServer.pas-revBASE.svn000.tmp.pas P nov. 11 12:13:37 2011 +++ C:/delphi/ics_svn/trunk/Delphi/Vc32/OverbyteIcsSysLogServer.pas P nov. 11 11:40:36 2011
@@ -198,7 +198,7 @@
            ((RawMessage[Index] >= 'A') and (RawMessage[Index] <= 'Z')) or
            ((RawMessage[Index] >= 'a') and (RawMessage[Index] <= 'z')) or
            ((RawMessage[Index] >= '0') and (RawMessage[Index] <= '9')) or
-            (RawMessage[Index]  = '.') or
+            (RawMessage[Index]  = '.') or (RawMessage[Index]  = '-') or
             (RawMessage[Index]  = '_')
           ) do
         Inc(Index);
@@ -455,6 +455,15 @@
         SMSec := '0';
     end;

+    SMsec := '0' + DecimalSeparator + SMSec;
+    DecodedMessage.Year     := StrToInt(SYear);
+    DecodedMessage.Month    := StrToInt(SMonth);
+    DecodedMessage.Day      := StrToInt(SDay);
+    DecodedMessage.Hour     := StrToInt(SHour);
+    DecodedMessage.Minute   := StrToInt(SMinute);
+    DecodedMessage.Second   := StrToInt(SSecond);
+    DecodedMessage.MilliSec := Trunc(1000 * StrToFloat(SMsec));
+
     case Delim of
     'Z', ' ' : DecodedMessage.TZBias := 0;
     '+', '-' :
@@ -486,14 +495,6 @@
               String(RawMessage) + '"');
     end;

-    SMsec := '0' + DecimalSeparator + SMSec;
-    DecodedMessage.Year     := StrToInt(SYear);
-    DecodedMessage.Month    := StrToInt(SMonth);
-    DecodedMessage.Day      := StrToInt(SDay);
-    DecodedMessage.Hour     := StrToInt(SHour);
-    DecodedMessage.Minute   := StrToInt(SMinute);
-    DecodedMessage.Second   := StrToInt(SSecond);
-    DecodedMessage.MilliSec := Trunc(1000 * StrToFloat(SMsec));
DecodedMessage.TimeString := String(Copy(RawMessage, Index1, Index - Index1));

     if (Index > Length(RawMessage)) or



OverbyteIcsSysLogServerDemo.pas.diff:
--- C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServerDemo1.pas-revBASE.svn000.tmp.pas P nov. 11 12:16:39 2011 +++ C:/delphi/ics_svn/trunk/Delphi/Internet/OverbyteIcsSysLogServerDemo1.pas P nov. 11 11:15:16 2011
@@ -53,16 +53,19 @@
     ToolsPanel: TPanel;
     DisplayMemo: TMemo;
     StartButton: TButton;
+    StopButton: TButton;
     procedure FormShow(Sender: TObject);
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure FormCreate(Sender: TObject);
     procedure StartButtonClick(Sender: TObject);
procedure SysLogServer1DataAvailable(Sender: TObject; const SrcIP, SrcPort,
       RawMessage: AnsiString);
+    procedure StopButtonClick(Sender: TObject);
   private
     FIniFileName : String;
     FInitialized : Boolean;
     FSysLogServer: TSysLogServer;
+    procedure SetButtons(Listening:Boolean);
   public
     procedure Display(Msg : String);
     property IniFileName : String read FIniFileName write FIniFileName;
@@ -89,6 +92,7 @@
     FSysLogServer := TSysLogServer.Create(Self);
     FIniFileName := OverbyteIcsIniFiles.GetIcsIniFileName;
     DisplayMemo.Clear;
+    FSysLogServer.OnDataAvailable := SysLogServer1DataAvailable;
 end;


@@ -150,14 +154,27 @@
     end;
 end;

+procedure TSysLogServerForm.SetButtons(Listening:Boolean);
+begin
+  StartButton.Enabled := not Listening;
+  StopButton.Enabled  := Listening;
+end;

+
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
 procedure TSysLogServerForm.StartButtonClick(Sender: TObject);
 begin
     FSysLogServer.Listen;
+    SetButtons(TRUE);
 end;


+procedure TSysLogServerForm.StopButtonClick(Sender: TObject);
+begin
+    FSysLogServer.Close;
+    SetButtons(FALSE);
+end;
+
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
 procedure TSysLogServerForm.SysLogServer1DataAvailable(
     Sender: TObject;


OverbyteIcsSysLogServerDemo.dfm.diff:
--- C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServerDemo1.dfm-revBASE.svn000.tmp.dfm P nov. 11 12:18:13 2011 +++ C:/delphi/ics_svn/trunk/Delphi/Internet/OverbyteIcsSysLogServerDemo1.dfm P nov. 11 11:15:00 2011
@@ -1,9 +1,9 @@
 object SysLogServerForm: TSysLogServerForm
   Left = 70
   Top = 187
-  Width = 379
-  Height = 247
   Caption = 'SysLogServer - http://www.overbyte.be'
+  ClientHeight = 220
+  ClientWidth = 371
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -32,12 +32,21 @@
       TabOrder = 0
       OnClick = StartButtonClick
     end
+    object StopButton: TButton
+      Left = 104
+      Top = 11
+      Width = 75
+      Height = 21
+      Caption = 'Stop'
+      TabOrder = 1
+      OnClick = StopButtonClick
+    end
   end
   object DisplayMemo: TMemo
     Left = 0
     Top = 41
     Width = 371
-    Height = 172
+    Height = 179
     Align = alClient
     Font.Charset = ANSI_CHARSET
     Font.Color = clWindowText


--
Regards
Peter
--- 
C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServerDemo1.pas-revBASE.svn000.tmp.pas
     P nov. 11 12:16:39 2011
+++ C:/delphi/ics_svn/trunk/Delphi/Internet/OverbyteIcsSysLogServerDemo1.pas    
P nov. 11 11:15:16 2011
@@ -53,16 +53,19 @@
     ToolsPanel: TPanel;
     DisplayMemo: TMemo;
     StartButton: TButton;
+    StopButton: TButton;
     procedure FormShow(Sender: TObject);
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure FormCreate(Sender: TObject);
     procedure StartButtonClick(Sender: TObject);
     procedure SysLogServer1DataAvailable(Sender: TObject; const SrcIP, SrcPort,
       RawMessage: AnsiString);
+    procedure StopButtonClick(Sender: TObject);
   private
     FIniFileName : String;
     FInitialized : Boolean;
     FSysLogServer: TSysLogServer;
+    procedure SetButtons(Listening:Boolean);
   public
     procedure Display(Msg : String);
     property IniFileName : String read FIniFileName write FIniFileName;
@@ -89,6 +92,7 @@
     FSysLogServer := TSysLogServer.Create(Self);
     FIniFileName := OverbyteIcsIniFiles.GetIcsIniFileName;
     DisplayMemo.Clear;
+    FSysLogServer.OnDataAvailable := SysLogServer1DataAvailable;
 end;
 
 
@@ -150,14 +154,27 @@
     end;
 end;
 
+procedure TSysLogServerForm.SetButtons(Listening:Boolean);
+begin
+  StartButton.Enabled := not Listening;
+  StopButton.Enabled  := Listening;
+end;
 
+
 {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
 procedure TSysLogServerForm.StartButtonClick(Sender: TObject);
 begin
     FSysLogServer.Listen;
+    SetButtons(TRUE);
 end;
 
 
+procedure TSysLogServerForm.StopButtonClick(Sender: TObject);
+begin
+    FSysLogServer.Close;
+    SetButtons(FALSE);
+end;
+
 {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
 procedure TSysLogServerForm.SysLogServer1DataAvailable(
     Sender: TObject;
--- 
C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServer.pas-revBASE.svn000.tmp.pas
  P nov. 11 12:13:37 2011
+++ C:/delphi/ics_svn/trunk/Delphi/Vc32/OverbyteIcsSysLogServer.pas     P nov. 
11 11:40:36 2011
@@ -198,7 +198,7 @@
            ((RawMessage[Index] >= 'A') and (RawMessage[Index] <= 'Z')) or
            ((RawMessage[Index] >= 'a') and (RawMessage[Index] <= 'z')) or
            ((RawMessage[Index] >= '0') and (RawMessage[Index] <= '9')) or
-            (RawMessage[Index]  = '.') or
+            (RawMessage[Index]  = '.') or (RawMessage[Index]  = '-') or
             (RawMessage[Index]  = '_')
           ) do
         Inc(Index);
@@ -455,6 +455,15 @@
         SMSec := '0';
     end;
 
+    SMsec := '0' + DecimalSeparator + SMSec;
+    DecodedMessage.Year     := StrToInt(SYear);
+    DecodedMessage.Month    := StrToInt(SMonth);
+    DecodedMessage.Day      := StrToInt(SDay);
+    DecodedMessage.Hour     := StrToInt(SHour);
+    DecodedMessage.Minute   := StrToInt(SMinute);
+    DecodedMessage.Second   := StrToInt(SSecond);
+    DecodedMessage.MilliSec := Trunc(1000 * StrToFloat(SMsec));
+
     case Delim of
     'Z', ' ' : DecodedMessage.TZBias := 0;
     '+', '-' :
@@ -486,14 +495,6 @@
               String(RawMessage) + '"');
     end;
 
-    SMsec := '0' + DecimalSeparator + SMSec;
-    DecodedMessage.Year     := StrToInt(SYear);
-    DecodedMessage.Month    := StrToInt(SMonth);
-    DecodedMessage.Day      := StrToInt(SDay);
-    DecodedMessage.Hour     := StrToInt(SHour);
-    DecodedMessage.Minute   := StrToInt(SMinute);
-    DecodedMessage.Second   := StrToInt(SSecond);
-    DecodedMessage.MilliSec := Trunc(1000 * StrToFloat(SMsec));
     DecodedMessage.TimeString := String(Copy(RawMessage, Index1, Index - 
Index1));
 
     if (Index > Length(RawMessage)) or
--- 
C:/DOCUME~1/Peter/LOCALS~1/Temp/OverbyteIcsSysLogServerDemo1.dfm-revBASE.svn000.tmp.dfm
     P nov. 11 12:18:13 2011
+++ C:/delphi/ics_svn/trunk/Delphi/Internet/OverbyteIcsSysLogServerDemo1.dfm    
P nov. 11 11:15:00 2011
@@ -1,9 +1,9 @@
 object SysLogServerForm: TSysLogServerForm
   Left = 70
   Top = 187
-  Width = 379
-  Height = 247
   Caption = 'SysLogServer - http://www.overbyte.be'
+  ClientHeight = 220
+  ClientWidth = 371
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -32,12 +32,21 @@
       TabOrder = 0
       OnClick = StartButtonClick
     end
+    object StopButton: TButton
+      Left = 104
+      Top = 11
+      Width = 75
+      Height = 21
+      Caption = 'Stop'
+      TabOrder = 1
+      OnClick = StopButtonClick
+    end
   end
   object DisplayMemo: TMemo
     Left = 0
     Top = 41
     Width = 371
-    Height = 172
+    Height = 179
     Align = alClient
     Font.Charset = ANSI_CHARSET
     Font.Color = clWindowText
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to