Performance implications of Synchronous Sockets vs Asynchronous Sockets

Posted by Akash Kava on Stack Overflow See other posts from Stack Overflow or by Akash Kava
Published on 2009-08-27T10:49:21Z Indexed on 2010/03/15 14:29 UTC
Read the original article Hit count: 863

We are trying to build an SMTP Server to receive mail notifications from various clients over internet. As each of the communication will be longer and it needs to log everything, doing this Asynchronous way is little challenging as well as by using Socket's Asynchronous methods we are not sure of how flow of control and error handling happens.

Previously we wrote lot of server/client apps but we always used Synchronous sockets, reason being they are longer sessions and each session also has lot of local data to manage and parsing messages etc.

Does anyone have any experience over real performance differences between these two methods? Async calls use ThreadPool which we have experienced many times to just die for no reason. And we fail to restart threadpool etc.

In one way Request-Response protocol of HTTP, Async Sockets makes sense, but SMTP/IMAP etc protocols are longer and they have interleaved messages plus state machine of server. So Async methods are really complicated to program.

However if anyone can share the performance of Sockets, it will be helpful.

© Stack Overflow or respective owner

Related posts about c#

Related posts about sockets