It is all much better explained here why blocking is better:
Maybe you should not believe everything you read on a web page...
Maybe you should use one of those libraries...
So I am wondering why ICS prefers events when the code is
so much simpler without them?
That's simply wrong.
Event d
> It is all much better explained here why blocking is better:
> http://www.ararat.cz/synapse/doku.php/about
I would not say that blocking is "better". Programming with synchronous
functions needs less callbacks and thus gives more compact code at the cost
of performance. If this is OK depends on
Let's say you are writing a multi-socket HTTP downloader such as the one in
the ICS demo. With sync/blocking sockets, you would have to launch multiple
threads per file. Why would you launch 4 threads for a 4Mbps DSL download
with thread syncronization hassle?
We use ICS async logic in our IQ Prox
> So I am wondering why ICS prefers events when the code is so much
> simpler without them?
ICS does not prefer events, it offers both blocking synchronous and
non-blocking async versions of most high level component methods.
So developers can make their own choice depending on application nee
Zvone wrote:
> When I looked at Indy and Ararat Synapse they both prefer blocking
> sockets to connect to text-based protocols like HTTP, POP, SMTP, FTP
> etc.
The main advantage of non-blocking is that you do not need one thread
per connection. Writing multi-threaded applications is not easy and
Abstraction classes, events and complexity are consulting bargains ;-)
-Message d'origine-
From: Zvone
Sent: Tuesday, February 22, 2011 2:26 PM
To: ICS support mailing
Subject: [twsocket] Why ICS prefers non-blocking sockets?
So I am wondering why ICS prefers events when the code i
I much prefer non-blocking. While receiving data from a httpcli f.e or over
a slow connection etc, my app keeps running while waiting for data. without
having to complicate it all with extra threads for everything.
On Tue, Feb 22, 2011 at 2:26 PM, Zvone wrote:
> When I looked at Indy and Ararat