|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Busy SocketsAssume for a moment (and yes, I DO know what happens when you assume
something ;), that at a given point in my Windows application that I try to use a socket and it tells me that it is "busy" and I KNOW, without a shadow of a doubt that it is NOT "busy". Is there a way to make this socket "unbusy" without rebooting the machine? Same thing for a file. Application crashes or whatever, and a filestream never releases, is there a way to "unbusy" the file without rebooting? We are actually running into both of these problems and are trying to figure out how to gracefully recover from these problems. TIA WhiteWizard aka Gandalf MCSD.NET, MCAD, MCT If you close the connection from one side it should inform the other
side and close it as well. I do not know if this will work for a busy Socket or not, but try calling <socketName>.Close() and have code on your other end that when the socket is closed it starts the process of reconnecting. WhiteWizard wrote: Show quoteHide quote > Assume for a moment (and yes, I DO know what happens when you assume > something ;), that at a given point in my Windows application that I try to > use a socket and it tells me that it is "busy" and I KNOW, without a shadow > of a doubt that it is NOT "busy". Is there a way to make this socket > "unbusy" without rebooting the machine? > > Same thing for a file. Application crashes or whatever, and a filestream > never releases, is there a way to "unbusy" the file without rebooting? > > We are actually running into both of these problems and are trying to figure > out how to gracefully recover from these problems. > > TIA > > WhiteWizard > aka Gandalf > MCSD.NET, MCAD, MCT > Same thing for a file. Application crashes or whatever, and a filestream Can you give a short but complete example of a process that opens a file ... > never releases, is there a way to "unbusy" the file without rebooting? the process terminates and yet the file stays open? When the app terminates the handle is automatically closed (or should be) This shouldn't happen .. Cheers, Greg Show quoteHide quote "WhiteWizard" <WhiteWiz***@discussions.microsoft.com> wrote in message news:50A8A5E0-1B61-4CAA-8B25-EF7614EAAD55@microsoft.com... > Assume for a moment (and yes, I DO know what happens when you assume > something ;), that at a given point in my Windows application that I try > to > use a socket and it tells me that it is "busy" and I KNOW, without a > shadow > of a doubt that it is NOT "busy". Is there a way to make this socket > "unbusy" without rebooting the machine? > > Same thing for a file. Application crashes or whatever, and a filestream > never releases, is there a way to "unbusy" the file without rebooting? > > We are actually running into both of these problems and are trying to > figure > out how to gracefully recover from these problems. > > TIA > > WhiteWizard > aka Gandalf > MCSD.NET, MCAD, MCT "WhiteWizard" <WhiteWiz***@discussions.microsoft.com> wrote Terminating the process that owns the socket will kill the socket.> Is there a way to make this socket > "unbusy" without rebooting the machine? The magic tool for sockets is "netstat", and it's part of the standard Windows Install. This will show you all sockets (-a), their state, and the process that owns the socket (-o). > Same thing for a file. Application crashes or whatever, and a filestream Same answer as for a socket. Kill the owning process.To find out which > never releases, is there a way to "unbusy" the file without rebooting? process owns a file, you need to hit the SysInternals web page and download one of their tools (FileMon?) > We are actually running into both of these problems and are trying to I suspect your problems is really something else - I do ALOT of socket and > figure > out how to gracefully recover from these problems. file work and almost never come across these issues unless it's due to a mistake on my end. Can you post some sample code?
How to stop an Application Pool in IIS 6.0 in c#?
Creating Events Help with Exception handling Creating the same class w/o duplicating? Array.Resize question Large object heap... Delegate Question: How does it know? Interop - string from dll issue Selecting a PictureBox convert string to string array |
|||||||||||||||||||||||