Article View: borland.public.cppbuilder.internet.socket
Article #1912Re: Indy UDP in a console app.
From: Peter Nunn
Date: Thu, 28 Sep 2006 23:47
Date: Thu, 28 Sep 2006 23:47
34 lines
1733 bytes
1733 bytes
Bob,
thankyou so much.. that was what was missing.
Now.. to see if I can start processes from a service and track them easily
Peter.
Bob Gonder wrote:
> pnunn wrote:
>
>>> THiddenDataModule* dm = new THiddenDataModule(NULL, argv[1], die);
>>> dm->file.open(argv[1]);
>>> dm->IdUDPServer->Active = false;
>>> //dm->IdUDPServer->DefaultPort = argv[2];
>>> dm->IdUDPServer->DefaultPort = 4000;
>>> dm->IdUDPServer->Active = true;
>
> Did you set IdUDPServer->ThreadedEvent to true?
>
>>> for(;;)
>>> {
>>> Sleep(100);
>>> if(die)
>>> break;
>>> }
> while( ! die )
> Sleep(100);
>
> But even better, especially for services, would be to use a WaitFor.
>
> You never closed the file.
> dm->file.close;
Technical Details
Message-ID:
<451c5ec9@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<44f789ba$1@newsgroups.borland.com> <44f7e8f1$1@newsgroups.borland.com> <4513c5be@newsgroups.borland.com> <qs7ih2hu9slk97mn4eegslbdj2fb5m0gc8@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b3954c31c7b052bb X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Message-ID: <451c5ec9@newsgroups.borland.com> From: Peter Nunn <pnunn@infoteq.com.au> Subject: Re: Indy UDP in a console app. Newsgroups: borland.public.cppbuilder.internet.socket Date: Fri, 29 Sep 2006 09:47:02 +1000 References: <44f789ba$1@newsgroups.borland.com> <44f7e8f1$1@newsgroups.borland.com> <4513c5be@newsgroups.borland.com> <qs7ih2hu9slk97mn4eegslbdj2fb5m0gc8@4ax.com> Lines: 35 Organization: InfoTeq Pty. Ltd. User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit NNTP-Posting-Host: 203.5.1.222 X-Trace: newsgroups.borland.com 1159487179 203.5.1.222 (28 Sep 2006 16:46:19 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail