🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: 50% datagram drop with Indy

#402
From: Remy Lebeau (TeamB)
Date: Wed, 30 Jan 2008 06:45
24 lines
1849 bytes
"syncopator" <bobback@inbox.com> wrote in message
news:479f9abe$1@newsgroups.borland.com...

> I'm using the UDP server from Indy 8, and receiving 50% of the packets.

That is because you are not taking into account that TIdUDPServer runs its
own threads internally for receiving packets.  So you are reading from the
same socket in multiple threads simultaneously.  Some data is going to be
received in your thread, and some data in TIdUDPServer's threads.

> I'm running the server in a high priority thread

Whatever you do to the thread that owns the TIdUDPServer instance will not
apply to the threads that TIdUDPServer creates internally.

>       Len=Form1->Server->ReceiveBuffer(Buffer,8192) ;

If you are going to do that in your own thread, then TIdUDPServer is the
wrong component to use.  Otherwise, you should let TIdUDPServer handle the
threading for you, and you can simply adjust its priority as needed.


Gambit
Technical Details
Message-ID: <47a01cc1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <479f9abe$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,c7dd64338b3bbbf8
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <479f9abe$1@newsgroups.borland.com>
Subject: Re: 50% datagram drop with Indy 
Date: Tue, 29 Jan 2008 22:45:58 -0800
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.29.61
Message-ID: <47a01cc1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1201675457 75.83.29.61 (29 Jan 2008 22:44:17 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail