I sent this earlier and it never appeared on the list.
The problem I am having is that TidUDPClient does not seem to work from a
console app.
Can anyone tell me why?
Doug
CODE___________________________________________
program Std2UDP;
{$APPTYPE CONSOLE}
uses
SysUtils,
Unit1 in 'Unit1.pas' {stdinToUDP: TDataModule};
begin
stdinToUDP.Run;
end.
_____________________________________________________________
unit Unit1;
interface
uses
SysUtils, Classes, IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient,
IdAntiFreezeBase, IdAntiFreeze;
type
TstdinToUDP = class(TDataModule)
UDP: TIdUDPClient;
IdAntiFreeze1: TIdAntiFreeze;
private
{ Private declarations }
public
Procedure Run;
end;
var
stdinToUDP: TstdinToUDP;
implementation
{$R *.dfm}
{ TDataModule1 }
procedure TstdinToUDP.Run;
var
Line : String;
i : Integer;
begin
for i := 1 to 100 do
UDP.Send(Format('Test %d', [i]));
// while not eof do
// begin
// ReadLn(Line);
// UDP.Send(Line);
// end;
end;
end.
_______________________________________________
object stdinToUDP: TstdinToUDP
OldCreateOrder = False
Left = 333
Top = 174
Height = 233
Width = 307
object UDP: TIdUDPClient
Active = True
BroadcastEnabled = True
Host = '255.255.255.255'
Port = 3092
Left = 16
Top = 24
end
object IdAntiFreeze1: TIdAntiFreeze
Left = 64
Top = 40
end
end
_______________________________________________________
I develop on Windows.
I am trying to develop a little tool to redirect stdin to a UDP port.
This allows me to redirect the log files of multiple Apache and email
servers to one place.
The application is simple - but how do I debug it??
Doug