BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"FReadList.SelectRead" no use ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Tao Lei
Guest





PostPosted: Fri Sep 22, 2006 6:17 pm    Post subject: "FReadList.SelectRead" no use ? Reply with quote



Hello.

I took a look at the codes of TIdUDPListenerThread.Run method.
I found the FReadList.SelectRead(AcceptWait) seems not necessary.
What is the real use of it, please?

Thank you.

////////////////////
IdUdpServer.pas
////////////////////
....
....
procedure TIdUDPListenerThread.Run;
var
PeerIP: string;
i, PeerPort, ByteCount: Integer;
begin

FReadList.SelectRead(AcceptWait); // After I delete this line, IdUdpServer also works well.

for i := 0 to FReadList.Count - 1 do
try
...
...
...
end;
....
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Sep 22, 2006 10:20 pm    Post subject: Re: "FReadList.SelectRead" no use ? Reply with quote



"Tao Lei" <worldwidestar (AT) sina (DOT) com.cn> wrote in message
news:4513e177 (AT) newsgroups (DOT) borland.com...

Quote:
I took a look at the codes of TIdUDPListenerThread.Run method.
I found the FReadList.SelectRead(AcceptWait) seems not necessary.
What is the real use of it, please?

SelectRead() waits for the socket a become signaled indicating that data has
arrived on it, before then reading it.

I assume that you are using Indy 10, is that correct? There is no FReadList
member in TIdUDPListenerThread anymore. In older versions of Indy,
TIdUDPServer ran a single TIdUDPListenerThread that continuously looped
through all of the available Bindings one at a time. That meant that the
server could only process 1 packet socket a time, regardless of how many
clients were sending data. TIdUDPServer has since been re-written awhile
ago to run multiple TIdUDPListener instances now, one for each Binding, much
like TIdTCPServer does. This way, multiple clients can be processed
simultaneously. You should consider upgrading.


Gambit
Back to top
Tao Lei
Guest





PostPosted: Sat Sep 23, 2006 5:34 am    Post subject: Re: "FReadList.SelectRead" no use ? Reply with quote



Thank you, yes, I am using Indy10.
Do you mean there is a newer version now ? Indy 11 ? How to upgrade ?

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote news:45141c0e$1 (AT) newsgroups (DOT) borland.com...
Quote:

SelectRead() waits for the socket a become signaled indicating that data has
arrived on it, before then reading it.

I assume that you are using Indy 10, is that correct? There is no FReadList
member in TIdUDPListenerThread anymore. In older versions of Indy,
TIdUDPServer ran a single TIdUDPListenerThread that continuously looped
through all of the available Bindings one at a time. That meant that the
server could only process 1 packet socket a time, regardless of how many
clients were sending data. TIdUDPServer has since been re-written awhile
ago to run multiple TIdUDPListener instances now, one for each Binding, much
like TIdTCPServer does. This way, multiple clients can be processed
simultaneously. You should consider upgrading.
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Sep 23, 2006 5:54 am    Post subject: Re: "FReadList.SelectRead" no use ? Reply with quote

"Tao Lei" <worldwidestar (AT) sina (DOT) com.cn> wrote in message
news:45148029 (AT) newsgroups (DOT) borland.com...

Quote:
Thank you, yes, I am using Indy10.
Do you mean there is a newer version now ? Indy 11 ?

No, not 11. But Indy is in constant development. The daily snapshots of
version 10.1.5 have newer code than what you showed earlier.


Gambit
Back to top
Tao Lei
Guest





PostPosted: Sat Sep 23, 2006 6:42 am    Post subject: Re: "FReadList.SelectRead" no use ? Reply with quote

But my indy version is indeed 10.1.5, I have checked it.
Could you send your indy source code to me, please ?

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote news:451486a4$1 (AT) newsgroups (DOT) borland.com...
Quote:

No, not 11. But Indy is in constant development. The daily snapshots of
version 10.1.5 have newer code than what you showed earlier.
Back to top
Tao Lei
Guest





PostPosted: Sat Sep 23, 2006 7:09 am    Post subject: Re: "FReadList.SelectRead" no use ? Reply with quote

I have found the source codes of the latest version.
Thank you for your information, Mr.Lebeau.
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Sep 23, 2006 8:11 am    Post subject: Re: "FReadList.SelectRead" no use ? Reply with quote

"Tao Lei" <worldwidestar (AT) sina (DOT) com.cn> wrote in message
news:45149044 (AT) newsgroups (DOT) borland.com...

Quote:
But my indy version is indeed 10.1.5, I have checked it.

There have been a lot of 10.1.5 releases. The version number has not been
rolled forward for awhile. Again, the code you showed earlier is NOT what
is in the current snapshot.


Gambit
Back to top
Tao Lei
Guest





PostPosted: Sat Sep 23, 2006 8:11 am    Post subject: Re: "FReadList.SelectRead" no use ? Reply with quote

"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote news:4514ae44$1 (AT) newsgroups (DOT) borland.com...
Quote:

There have been a lot of 10.1.5 releases. The version number has not been rolled forward for awhile.

Yes, I have just noticed this.

Quote:
Again, the code you showed earlier is NOT what is in the current snapshot.

Again, thank you.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.