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 Proxy Server (http://www.iqproxyserver.com) to avoid "thread-hell". Most of the times, when you fire more than 1400 threads in Windows, it crashes. We have successfully tested 60k connections in our proxy server thanks to ICS/async-winsocks! Regards, SubZero On Tue, Feb 22, 2011 at 3:26 PM, Zvone <pha...@gmail.com> 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 reason - because communication is flowed - you send command, you wait > reply, if reply does not match you handle error. It is all nice > line-by-line > inline code. > > With ICS it uses events to reply to reply codes and non-blocking. But with > this you lose - easy to follow code flow. If you really need to make it > independent you simply put it in separate thread - both Indy and Synapse > have their own way of solving this - Indy has special component for > threading sockets and Synapse some kind of function that gets called every > once in a while. > > It is all much better explained here why blocking is better: > http://www.ararat.cz/synapse/doku.php/about > > So I am wondering why ICS prefers events when the code is so much simpler > without them? > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be