1

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?
Community
  • 1
  • 1
Zeta Two
  • 1,776
  • 1
  • 18
  • 37

1 Answers1

1

Cassini project is what you need. Also you can look at XSP in mono.

You should be able to embed those projects into your code and host ASP.NET. If that is not possible you can start looking XSP sources and implement the web server part yourself.

Vadym Stetsiak
  • 1,974
  • 18
  • 22