How many socket connections can a web server handle?

In short: You should be able to achieve in the order of millions of simultaneous active TCP connections and by extension HTTP request(s). This tells you the maximum performance you can expect with the right platform with the right configuration. Today, I was worried whether IIS with ASP.NET would support in the order of 100 … Read more

Print TCP Packet Data

How to print data from TCP packets Below is an example which does exactly what you need: hook received TCP packets and print their payloads. If you want to print some other information from received packet (like binary data), you just need to modify a bit the section under this comment: /* —– Print all … Read more

close() is not closing socket properly

Here is some code I’ve used on many Unix-like systems (e.g SunOS 4, SGI IRIX, HPUX 10.20, CentOS 5, Cygwin) to close a socket: int getSO_ERROR(int fd) { int err = 1; socklen_t len = sizeof err; if (-1 == getsockopt(fd, SOL_SOCKET, SO_ERROR, (char *)&err, &len)) FatalError(“getSO_ERROR”); if (err) errno = err; // set errno … Read more

High performance TCP server in C#

It must be async, there is no way around this. High performance and scalability don’t mix with one-thread-per-socket. You can have a look at what StackExchange themselves are doing, see async Redis await BookSleeve which leverages the CTP features from the next C# release (so is on the edge and subject to changes, but it … Read more