Article View: borland.public.cppbuilder.internet.socket
Article #1902Re: Indy UDP in a console app.
From: Bob Gonder
Date: Tue, 26 Sep 2006 13:49
Date: Tue, 26 Sep 2006 13:49
24 lines
1672 bytes
1672 bytes
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:
<qs7ih2hu9slk97mn4eegslbdj2fb5m0gc8@4ax.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!208.48.142.85!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!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>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b3954c31c7b052bb X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: Indy UDP in a console app. Date: Tue, 26 Sep 2006 06:49:04 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <qs7ih2hu9slk97mn4eegslbdj2fb5m0gc8@4ax.com> References: <44f789ba$1@newsgroups.borland.com> <44f7e8f1$1@newsgroups.borland.com> <4513c5be@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.86.11 X-Trace: newsgroups.borland.com 1159278543 69.69.86.11 (26 Sep 2006 06:49:03 -0700) Lines: 28 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!208.48.142.85!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail