handles AwaitAsync finishing synchronously
authorGreg Young <gregoryyoung1@gmail.com>
Wed, 2 Mar 2016 21:28:49 +0000 (23:28 +0200)
committerGreg Young <gregoryyoung1@gmail.com>
Mon, 7 Mar 2016 13:24:01 +0000 (15:24 +0200)
commit123aaa5db07fe464d12ea178ecc3f27990cc1a72
tree26534a0d4e92604e92258251ceb36afadc1037b7
parentaf315df3ab13d99d05b3aa0ca26e7022449cf275
handles AwaitAsync finishing synchronously

A connect flood will break the async loop and take down the entire HttpListener instance (will stop accepting connections).

To reproduce. Take a HttpListener run say 2 wrk test instances against it (1000 connections each works here). After the run the HttpListener has broken its async loop and will no longer accept any connections after. The reason for this is that it was not previously handling the case that AcceptAsync can return synchronously. In this case event will not be called with args.

Patch handles this case and the above issue is not reproducible with.
mcs/class/System/System.Net/EndPointListener.cs