| View previous topic :: View next topic |
| Author |
Message |
Atle Smelvær Guest
|
Posted: Mon Feb 16, 2004 3:22 pm Post subject: Delphi implementations of an IOCP server |
|
|
Is there any IOCP server implementation in Delphi? I know that Indy10 will
have this functionality, but at this point IOCP inside Indy is not working
as it should, and I'm sure that it will be a long time before they release a
final Indy10 since there are still mutch do before it's finished. Also, I'm
using Indy9 on other projects, and it is not possible to have both installed
without a lot of rewriting inside Indy10.
I've looked on the internet but found nothing, so now I'm making an IOCP
server. But if there is any components out there at a reasonable price, it
would cost me less in time spend developing this piece.
Anyone of you who have made a good IOCP server, or knows about one. The
sourcecode must be available.
-Atle
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Mon Feb 16, 2004 4:18 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
"Atle Smelv r" <atle (AT) datagrafikk (DOT) no> wrote in
news:4030e02b (AT) newsgroups (DOT) borland.com:
| Quote: | Is there any IOCP server implementation in Delphi? I know that Indy10
will have this functionality, but at this point IOCP inside Indy is not
working as it should, and I'm sure that it will be a long time before
|
Actually it does work and has for some time. Its not optimized yet but its
already running 4x faster than plain Indy. I showed this back in
October/November at BorCon.
| Quote: | they release a final Indy10 since there are still mutch do before it's
finished. Also, I'm using Indy9 on other projects, and it is not
|
Actually there isnt a lot left. Its pretty close. Its mostly optimizations,
test suites, etc..
| Quote: | possible to have both installed without a lot of rewriting inside
Indy10.
|
You dont need to do any rewrite. I have about 7 versions installed on my
system. Indy in Depth even shows how to do this.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Is Indy useful to you? Send a postcard please!
http://www.hower.org/kudzu/indypost.html
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Mon Feb 16, 2004 4:22 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
| Quote: | You dont need to do any rewrite. I have about 7 versions installed on my
system. Indy in Depth even shows how to do this.
|
Shameless plug, (but I'm going to buy it anyway).
Rgds,
Martin
|
|
| Back to top |
|
 |
Lukas Gebauer Guest
|
Posted: Mon Feb 16, 2004 4:38 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
Atle Smelvær wrote:
| Quote: | Is there any IOCP server implementation in Delphi? I know that Indy10 will
have this functionality, but at this point IOCP inside Indy is not working
as it should, and I'm sure that it will be a long time before they release a
final Indy10 since there are still mutch do before it's finished. Also, I'm
using Indy9 on other projects, and it is not possible to have both installed
without a lot of rewriting inside Indy10.
I've looked on the internet but found nothing, so now I'm making an IOCP
server. But if there is any components out there at a reasonable price, it
would cost me less in time spend developing this piece.
Anyone of you who have made a good IOCP server, or knows about one. The
sourcecode must be available.
|
Try take a look to:
http://www.ararat.cz/synapse/files/contrib/IocpPool.zip
It is some IOCP based code for Synapse.
--
Lukas Gebauer.
http://www.ararat.cz/synapse/ - Ararat Synapse - TCP/IP Lib.
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Mon Feb 16, 2004 6:03 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
"Martin James" <mjames_falcon (AT) dial (DOT) pipex.com> wrote in
news:4030ee4f (AT) newsgroups (DOT) borland.com:
| Quote: | Shameless plug, (but I'm going to buy it anyway).
|
Thanks. Im sure you'll find it worth every EuroCent. :)
Indy 10 material is in there now, and more is coming.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Qualified help FAST with Indy Experts Support
from the experts themselves:
http://www.atozed.com/indy/experts/support.iwp
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
| Back to top |
|
 |
Zinvob Guest
|
Posted: Mon Feb 16, 2004 6:33 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
Ok. I see that I've not done enough research here before I say something :)
I'll look into it. Do you have a link to Indy in depth, where parallell
installs of Indy9 and Indy10 is covered.
Thanx for your info.
-Atle
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Mon Feb 16, 2004 10:04 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
"Zinvob" <zinvob (AT) sdf (DOT) lonestar.org> wrote in news:40310c45
@newsgroups.borland.com:
| Quote: | I'll look into it. Do you have a link to Indy in depth, where parallell
installs of Indy9 and Indy10 is covered.
|
http://www.atozed.com/indy/book/
You can click on Table of Contents from there. Its one of the chapters
towards the end.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Want more Indy stuff? Try the Atozed Indy Portal at
http://www.atozedsoftware.com/
* More Free Demos
* Free Articles
* Extra Support
|
|
| Back to top |
|
 |
Atle Smelvær Guest
|
Posted: Tue Feb 17, 2004 8:03 am Post subject: Re: Delphi implementations of an IOCP server |
|
|
Why is the indy10.zip removed from the CSV archive, I would like to have the
newest version, not a backup from last year?
-Atle
|
|
| Back to top |
|
 |
Atle Smelvær Guest
|
Posted: Tue Feb 17, 2004 8:26 am Post subject: Re: Delphi implementations of an IOCP server |
|
|
I just wondered how your worker threads are built inside Indy10. The server
I was creating, had a self growing worker pool. Each time a worker thread
was starting to read or send a message, an IdleThreads counter was
decremented, and a WorkingThreads counter was incremented. When a client
decremented the IdleThreads, it also checked if it's reached zero. When zero
is reached, it creates another WorkerThread before continuing. This way, you
never freeze the server when heavy actions are done on some of the threads,
still keeping the thread count as low as possible. When the worker thread
was going into idle state again and idle threads was to be incremented, it
finished itself if idle threads already was 2*cpus on system. IOCP is
perfect for this kind of worker threads.
-Atle
|
|
| Back to top |
|
 |
Atle Smelvær Guest
|
Posted: Tue Feb 17, 2004 8:56 am Post subject: Re: Delphi implementations of an IOCP server |
|
|
One more question. Is there a threadsafe way to send packets and disconnect
outside the read thread in Indy10?
Thanx
-Atle
|
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Tue Feb 17, 2004 10:29 am Post subject: Re: Delphi implementations of an IOCP server |
|
|
My approach is to just create another handler thread if one is needed *and*
the queue of free handler threads is empty. The create has to be done
sometime, so why not so it as required? If you create a spare thread just
when the queue becomes empty, and you do not know if another will be needed
will this not create a thread too far?
Rgds,
Martin
|
|
| Back to top |
|
 |
Atle Smelvær Guest
|
Posted: Tue Feb 17, 2004 11:50 am Post subject: Re: Delphi implementations of an IOCP server |
|
|
Since IOCP works with GetQueuedCompletionStatus, you need to have a thread
waiting on this API call. That's why a new thread is created at once. By
doing this I make sure that there's always one thread waiting on a
CompletionStatus, ready to start working if something happens. Once the
other thread is finished, it will always clean up itself if the amount of
needed idle threads are intact.
|
|
| Back to top |
|
 |
willy Chandra Guest
|
Posted: Tue Feb 17, 2004 5:26 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
hi Atle,
i think you should check the IOCP Classes in sourceforge. there is 1 project written in Delphi + IOCP
ciaoo Willy
"Atle Smelvær" <atle (AT) datagrafikk (DOT) no> wrote:
| Quote: | Is there any IOCP server implementation in Delphi? I know that Indy10 will
have this functionality, but at this point IOCP inside Indy is not working
as it should, and I'm sure that it will be a long time before they release a
final Indy10 since there are still mutch do before it's finished. Also, I'm
using Indy9 on other projects, and it is not possible to have both installed
without a lot of rewriting inside Indy10.
I've looked on the internet but found nothing, so now I'm making an IOCP
server. But if there is any components out there at a reasonable price, it
would cost me less in time spend developing this piece.
Anyone of you who have made a good IOCP server, or knows about one. The
sourcecode must be available.
-Atle
|
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Tue Feb 17, 2004 7:02 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
"Atle Smelv r" <atle (AT) datagrafikk (DOT) no> wrote in
news:4031cad0$1 (AT) newsgroups (DOT) borland.com:
| Quote: | Why is the indy10.zip removed from the CSV archive, I would like to have
the newest version, not a backup from last year?
|
Huh?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Want to keep up to date with Indy?
Join Indy News - it free!
http://www.atozed.com/indy/news/
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Tue Feb 17, 2004 7:02 pm Post subject: Re: Delphi implementations of an IOCP server |
|
|
"willy Chandra" <willy.chandra (AT) web (DOT) dot.de> wrote in
news:40324eda$1 (AT) newsgroups (DOT) borland.com:
| Quote: | i think you should check the IOCP Classes in sourceforge. there is 1
project written in Delphi + IOCP
|
Its a basic wrapper around IOCP - it doenst isloate you from the
impelemntation details of IOCP.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Got Indy? Got the book?
http://www.atozed.com/indy/book/
|
|
| Back to top |
|
 |
|