Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2005

Tip: Looking for answers? Try searching our database.

File Handle gets closed between two separate WS requests

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alvin - 20 Dec 2005 19:50 GMT
Hi

Even though each Request is supposed to open the file and close it
independently. Could it be possible that one request afftects the second one?

I would really appreciate your help.
Thanks
Alvin

Basically the code looks like this:

Public class Service: System.Web.Services.Webservices
{
    public Service() {
    }
    publicn ServiceRequest()
   {
      fs = File.Open()
      Debug.Listeners.Add(TextWriterTraceListener(fs);
      Debug.Write();
      ...
      ...
      Debug.Write()
      Debug.Flush()
      fs.Flush()
      fs.Close()
   }

}
Martin Kulov - 20 Dec 2005 23:03 GMT
> Hi
>
> Even though each Request is supposed to open the file and close it
> independently. Could it be possible that one request afftects the second
> one?

Hi Alvin,
Why do you think that one request affects another? What happens in your
code?
I see two possible issues in your code.
First there is no try-finally clause. The use of using directive is
recommended.
Also you are closing the file before you have removed it from the listener
collection. Could it be your problem?

Regards,

Signature

Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.