0

Here is the deal... I have created a web service (asmx) which is running a long time consuming procedure in a class and returns the result. The web service is served in my local windows 10 IIS connected to the router with port forwarding. The android device connected to the same router (as the iis) accesses the web service in IIS with the outside IP (my router's IP on the internet - for checking purposes). I noticed that the first device accessing the service is served ok but the second delays big time to be served. Checking the net I found that there is a restriction in serving devices from the same IP. I disconnected one of the devices from the WLAN and everything worked as a charm. Both devices were served in the same time. How can I overcome this problem?

Thanks in advance

  • "I disconnected one of the devices from the WLAN and everything worked as a charm." If that works, you should reconsider your network setup (which address goes to which device), and I don't think it is related programming. – Lex Li Oct 02 '18 at 21:43
  • Both Android devices use their own fixed local lan ip (static) and also the "server" (all are different). I created also an aspx page that displays the visitor's IP and visited the IIS from both android devices (writting in chrome in android the outside IP) and both display the same outside IP (and this is logical). – Nikolaos Hatzistelios Oct 02 '18 at 22:25
  • I would also like to add the following: When I visited it from the first device, then when I visited it with the second the second delayed again and finally was served (the order of the devices was changed for checking purposes with the same results). I am totally confused. It is not device based definitelly. It is not also network based. It is more likely .net based (ASP.NET settings in IIS) or IIS settings based. – Nikolaos Hatzistelios Oct 02 '18 at 22:37

1 Answers1

0

Searching the Internet I discovered (there are huge chances that I may be wrong) that this might have to do with the default behavior of DotNet framework which locks the session to the first in first served device:

ASP.NET application to serve multiple requests from a single process

and

Android http connection - multiple devices cannot connect the same server

I suppose that my IIS assumes that the attempt to hit the web service from the second device is another attempt by the same device. I also suppose that it assumes the device to be the same device since it is the same application with the same internal environment hitting the web service and it can't tell that they are two different devices. I tried to reproduce this error and check if I am right by hitting the IP reporting page in IIS from two different tabs of the Mozzila Developer edition browser but it works ok (so I am not sure if it is a session issue). I also found a report that the issue is present only in android devices but it was not clear enough if the server was IIS... The solution mentioned was "incorrect flag on the tcp kernel settings - Reuse connection". Does it tell anything to anyone of you?

If the session lock is indeed the problem is there a solution to make IIS distinguish that there are two devices indeed? Is there a setting in IIS that would change this default behavior of DotNet?

I am sure there is a solution (if indeed the issue is session lock) because I uploaded my code to an on-line server and it works perfect when hitting it from two Android devices. So either it is not a session lock issue or there is a setting that it changes this behavior of DotNet in IIS... Is anyone aware of such a setting?