Hello everyone,
I currently clean-up resource in an HttpListenerContext instance in this way.
- Get Request.InputStream, and Close it;
- Get Response.OutputStream, and Close it.
My question is,
Is it the correct way to clean-up resouces? Since I did not fonud a Dispose or Close method for this class. Are there any more elegant way to clean-up resouce for HttpListenerContext?
thanks in advance,
George
George GeorgePosted Jun 4, 2008, 4:43 AM
Thanks Paresh!
I think if I completed input reading and ouput writing, I should call Request.InputStream.Close() and Response.OutputStream.Close(), other than call Clear, right?
regards,
George
Paresh DesaiPosted Jun 4, 2008, 4:33 AM
Response.OutputStream.Close();
Close the current stream and release the any resorces which is associated with them.
Response.Clear();
Clear all the content from current context.