On my tests with the server, the content length is only sent for a POST, and not sent with a GET. If the form's enctype attribute has been set, then the POST contains the header that divides the data into the various portions for processing. I believe that the data is BASE64 encoded if it's binary to conform to the protocol standards.
The content-length is in the primary set of data that's received from the socket. I need to get that - examine it, and the determine how much data I should wait to accept before continuing. I still need to implement the server response codes for it, which I will probably do this weekend, and perhaps experiment with the Async methods instead of using the AcceptSocket() method of the TCPListener class. I had a special reason for writing my own server. This one does not need to scale. It allows me to do something that I've been trying to figure out how to do for a very long time, but with little success. I would also like to be able to figure out how to write my own component that allows me to call a delegate on the thread that my object was created on, when I create a new thread to execute other code on and I want to raise an event with that delegate. If any of you have any information on how to do that I would be most appreciative. Currently, I'm using a form (control base) that has the Invoke method. This method will execute a delegate on the original thread that the form was created on, instead of the current thread which is what I'm after. Thanks, Mike On 3/28/06, Mark Smith <[EMAIL PROTECTED]> wrote: > > > Is that true for a client as well? I thought the client had > > to keep the connection open in order to receive the server's > > response. I know the > > *server* can omit Content-Length and close the connection; > > but it seems that would be not-very-useful for a client to do. > > All header entity values apply to either client or server. There's a > whole > section in the spec (section 4.4) that talks about message lengths and how > to determine them based on Content-Length presence and Transfer-Encoding > types. > > That said, for HTTP 1.1 applications, the server can respond back with 400 > (Bad request) or 411 (Length required) if it wishes to insist on receiving > a > valid Content-Length. I would certainly expect the length to be present > in > most cases unless it's just a really old application. > > mark > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
