WebServer.StopLocalServer() does not close underlying socket

Please see the description of my issue and my follow-up comments here https://gadgeteer.codeplex.com/workitem/2698.

I thought I had a work around, but apparently it’s still lacking.

I do not have an answer but now your hidden link is revealed.

Aha, I read his name and assumed somehow he made the link hidden but it was just because he was a newbie

Any word? Has Windows 10 on Raspberry Pi 2 distracted everyone? :slight_smile:

http://www.hanselman.com/blog/SettingUpWindows10ForIoTOnYourRaspberryPi2.aspx

I’m pretty sure people are doing their own things - some of them certainly are RPi2, but not everyone :slight_smile:

Anyway, I didn’t understand your last comment on codeplex. The cable gets removed, then you make a request to the server before the stop() happens ? In that scenario the request should never hit the device because the cable is out ?!?

  1. Ethernet Cable Connected
  2. Web Server Started
  3. HTTP Client Request
  4. HTTP Server Response
  5. Ethernet Cable Disconnected
  6. Web Server Unstoppable
  7. Wait ~10 seconds
  8. Ethernet Cable Connected
  9. Web Server Start Fails

The part that threw me off was that steps 3 and 4 have to happen - a client must make an HTTP request to the web server. If steps 3 and 4 do not happen, I’m able to stop the web server (step 6) properly, so everything works. It seems as if adding steps 3 and 4 causes a thread to be spun up such that the socket cannot be closed?

Since nobody responded, I posted my unacceptable, hacky work around in the comments section of the codeplex page which I referenced earlier in this thread.