🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #5585

Indy TIdTCPServer creation at untime

#5585
From: J�nior B. Dymow
Date: Fri, 16 Jul 2004 18:51
33 lines
1935 bytes
Hi,

    I'm using Indy 9, and I'm having some problems when I create a
TIdTCPServer at runtime. It works fine when I create it at designtime, but
in runtime it doesn't receive any connection. I really need to use it at
runtime, since may app runs as a service and doesn't have a form. This is
the that code I'm using in my teste application (this is not the service,
just an application to discover what's happening).

        ApServerSocket = new TIdTCPServer(Application);
        ApServerSocket->Active= false;
        ApServerSocket->DefaultPort= 5001;
        ApServerSocket->OnConnect= vServerSocketConnectEvent;
        ApServerSocket->Active= true;


void __fastcall TForm1::vServerSocketConnectEvent(TIdPeerThread *kpThread)
{
    ShowMessage("This host has been connected: " +
kpThread->Connection->LocalName);
}

    Am I doing something wrong? At design time, I assign exactly the same
function to the OnConnect event and it works properly.

    Thanks

=======================
J�nior B. Dymow
Software Designer
Specto Pain�is Eletr�nicos
junior@specto.com.br
=======================
Technical Details
Message-ID: <40f822f9@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,245bc6439db2ac9c,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII
From: "J�nior B. Dymow" <junior@specto.com.br>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Indy TIdTCPServer creation at untime
Date: Fri, 16 Jul 2004 15:51:05 -0300
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 200.135.30.176
Message-ID: <40f822f9@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090003705 200.135.30.176 (16 Jul 2004 11:48:25 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail