Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: Looking for very basic indy 10 server examples
| Subject: | Re: Looking for very basic indy 10 server examples |
| Posted by: | "Mark Smith" (marksmi..@jungle-monkey.com) |
| Date: | Thu, 24 Jan 2008 02:53:00 |
OK, there was a small typo in that one.
I've got as far as this now. It tells me
"[DCC Error] ServerTest.dpr(10): E2003 Undeclared identifier:
'TIdPeerThread'"
So, where is TIdPeerThread defined?
Thanks
program ServerTest;
{$APPTYPE CONSOLE}
uses
SysUtils,IdBaseComponent,IdComponent,IdTCPServer;
var
svr:TIdTCPServer;
procedure Execute(AThread: TIdPeerThread);
begin
end;
begin
svr:=tidtcpserver.Create();
svr.Bindings.DefaultPort := 1000;
svr.onexecute:=Execute;
svr.Active:=true;
while true do sleep(10000);
end.
Mark Smith wrote:
> I'm trying to learn how to use indy. A lot of the examples I can find
> online assume I am embedding the indy component within a form.
>
> I just want a simple console application to be able to act as a server.
> Once I can talk to that with telnet I was going to write a basic client
> and work my way up from there.
>
> I can't even get as far as creating the server:
>
> program ServerTest;
>
> {$APPTYPE CONSOLE}
> uses
> SysUtils,IdTCPServer;
>
> var
> svr:TIdTCPServer;
>
> begin
>
> svr:= idtcpserver.create();
>
> end.
>
>
> It seems to expect an owner in the constructor, I am very new to delphi
> but this does not seem to make sense within the context of a console app.
>
> Can someone give me the bare bones of a server that accept connections
> on a given port and prints whatever it receives on the screen?
>
> Thanks