2

I have an application running on Win8.1 (or WinServer2012, it makes no difference) that provides two HTTP server listeners in separate processes (one using HTTP.SYS via .NET HttpListener, the other using Microsoft OWIN and self-hosted ASP.NET WebAPI).

The firewall has been configured with Allow rules to allow connections to the two servers (via TCP port-based rules) to the Local Subnet.

Each client makes three LongPoll connections to the server (two to HTTP.SYS and one to OWIN), in addition to whatever connections are needed to load the initial HTML/JS/image resources. It's using a WebKit-based browser in Linux to do everything.

With a small number of clients, everything works perfectly. (In some cases even a large number of clients also works perfectly; I haven't been able to identify a specific trigger for this issue.)

After connecting about 12 such clients, some of the latter ones have trouble connecting to the server -- they just sit waiting to connect without apparently loading anything (or sometimes they only load some of the resources, eg. they connect to one server successfully but not the other). Once they actually get a connection through they tend to continue working, since the browser re-uses existing connections for subsequent requests.

Observing with Wireshark on the server shows that the HTTP request is received at the network layer but the server application doesn't see it. Every two minutes a TCP Retransmission is seen from the client network stack trying to re-send the original request. After about 15 minutes the client gives up and reports the failure to the client application, which then disconnects and reconnects; sometimes starting the retransmission cycle again and sometimes working perfectly.

The problem is reproducible by physically disconnecting and reconnecting the Ethernet cables on all client devices -- some will get through while others will go into Retransmission loops as above. Oddly pulling the power on all client devices and then starting them up simultaneously does not usually trigger the issue.

Disabling the Windows Firewall on the server machine appears to resolve all problems. Is there a setting somewhere that needs changing to resolve this while keeping the firewall enabled?

Miral
  • 169
  • 1
  • 7
  • 1
    Windows 8 is not a server platform. – EEAA Jul 05 '16 at 02:28
  • True, but I'm not talking hundreds or thousands of client connections here. A server-like app with a small number of client connections seems normal even for standard desktop use. – Miral Jul 05 '16 at 02:47
  • 2
    Negative. If you are writing a server application, use a server OS. The symptoms you are experiencing are indicative of you attempting to use a a desktop OS. – EEAA Jul 05 '16 at 02:48
  • 1
    FWIW, the same problem occurs with the server application running on Windows Server 2012. And this is not off-topic. – Miral Jul 08 '16 at 00:26

0 Answers0