clean up resource in HttpListenerContext

This is a discussion on clean up resource in HttpListenerContext within the C# Programming forums, part of the General Programming Boards category; Hello everyone, I currently clean-up resource in an HttpListenerContext instance in this way. - Get Request.InputStream, and Close it; - ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    clean up resource in HttpListenerContext

    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

  2. #2
    Ex scientia vera
    Join Date
    Sep 2007
    Posts
    478
    Hey, I know.

    GOOGLE IT.

    Seriously, you have like the 20 last posts in the C# forum. Do you think everyone that replies to your posts know the answer off the top of their head? Unlikely. Where do they go to find the answer? Well, google will do a good job, but most google searches will direct the searchers to MSDN anyway.

    Believe me, if there exists information on whether or not doing it your way is the correct way or not, it'll be on the language's designers website, don't you think?
    "What's up, Doc?"
    "'Up' is a relative concept. It has no intrinsic value."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting out a resource manager
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 11-10-2008, 07:12 PM
  2. unmanaged resource
    By George2 in forum C++ Programming
    Replies: 2
    Last Post: 01-03-2008, 04:23 AM
  3. CreateProcess with Resource of executable, not the Filename
    By Ktulu in forum Windows Programming
    Replies: 4
    Last Post: 11-04-2006, 01:07 AM
  4. Generic Resource_Manager WIP with lots TODO
    By Shamino in forum C++ Programming
    Replies: 19
    Last Post: 02-01-2006, 01:55 AM
  5. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21