Background
I'm trying to implement a simple web server part as a web interface to a desktop application. I first tried HTTPListener which worked but required admin privileges (in some way or another) which I felt was unnecessary. I'm now trying a TcpListener based approach.
Progress
Serving files works good but I'm having a problem with file uploads. I basically tried to use the answer found in another question but instead of plugging in HttpListenerContext.Request.InputStream I used TcpClient.GetStream().
Problem
The problem is that this seems to be working very randomly. Sometimes it works fine but most of the times it doesn't. When it doesn't work the thread doesn't seem to do anything until I press abort in my browser and it proceeds to throw an exception "Start boundary not found" (see the code in the link).
Question
Now, my questions are:
- Am I doing this the right way or are there any simpler way to create an HTTP server (third-party libraries included)?
- What could be the possible causes for my problem?
- What parts of code would you need to see to help me further?