From 7d97555f93891543c5dd416bf7597310460081b6 Mon Sep 17 00:00:00 2001 From: Norrapat Nimmanee Date: Wed, 22 Jul 2015 21:42:32 +0700 Subject: [PATCH] Close stream after read file Need to close this stream to clear lock file. And can read this file again. --- SimpleHttpServer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SimpleHttpServer.cs b/SimpleHttpServer.cs index 66b1067..8550fd0 100755 --- a/SimpleHttpServer.cs +++ b/SimpleHttpServer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.IO; using System.Net; @@ -216,6 +216,7 @@ public override void handleGETRequest (HttpProcessor p) p.writeSuccess("image/png"); fs.CopyTo (p.outputStream.BaseStream); p.outputStream.BaseStream.Flush (); + fs.Close(); } Console.WriteLine("request: {0}", p.http_url);