|
Will it give information about network latency, data packets, etc.? No, it won't expose anything more than an extra statement to set a break point on.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
When you step over it, it will take a long time to execute the Flush statement.
It would solve the mystery for me, maybe someone else would be too dense.
|
|
|
|
|
Richard Andrew x64 wrote: maybe someone else would be too dense.
An uncalled for statement. If you can't remain civil then please don't comment.
There are other ways to debug a problem than just hitting F10. Knowing and understanding the processing that are occurring is also a big help.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Look who's talking about being civil!
You're the guy who's always breaking Rule 3 in HOW TO ANSWER A QUESTION.
|
|
|
|
|
I certainly didn't mean to start a fight over debugging...
|
|
|
|
|
No fighting. Some people just resort to insults and deflection when their arguments can't be defended professionally.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Have you trying just using File.Copy to see if there is any difference? It does basically the same thing but it may be something to test. Otherwise I'd say it's just the process of finalizing the writing of a large file, nothing you're going to solve without stepping into the unmanaged realm.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes, my original statemet was
File.Copy(nd_CopyDrive.LocalDrive + "\\" + fi.Name, nd_CopyDrive.LocalDrive + "\\Archive\\" + fi.Name, b_overwrite);
This had the exact same delay.
|
|
|
|
|
Then again, I'd say there is nothing you're going to be able to do about it. Aside from performing the copy operation on the system where the files reside rather than going through a mapped drive.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Taking what you said
Aside from performing the copy operation on the system where the files reside rather than going through a mapped drive.
How can I do that?
|
|
|
|
|
Create a service on the machine which you can call or somehow trigger. Perhaps a WCF service, remember WCF isn't just for web, it is also used for interprocess communication
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
That's going to be difficult. There are ~600 devices this has to happen to.
|
|
|
|
|
svanwass wrote: devices
I thought you were mapping a drive to a server?
Anyway, not much more to be said. Other than decreasing the size of the file, which I'm sure is not an option, there isn't anything more you can do that I'm aware of.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yea, I have to map to 600 servers, archive some files (one of which is large) then copy over new version of those files.
|
|
|
|
|
Oh, and I did add all these statements after the while loop:
destStream.Flush();
destStream.Close();
destStream.Dispose();
Close is where it is hanging at. More thoughts?
|
|
|
|
|
As I said it's the process of finalizing and closing a large file. The data must be validated and header information written to the file and entries made in the FAT.
Of course, performance may also be affected by the performance of your network and any IO operations also being performed on the destination disk.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
try setting buffer length to less as possible but moderate enough.
I usually use 512KB or 1MB buffer length for large file handling.
Hope this will help you
|
|
|
|
|
How would the size of my buffer change the delay when calling the Close method? Wouldn't a smaller/larger buffer size effect the Flush method only?
|
|
|
|
|
Because the size of your file there's not much that can be done, but have you tried BeginWrite and EndWrite??? prolly asynchronous write can help...
I want to die like my grandfather- asleep, not like the passengers in his car, screaming!
|
|
|
|
|
No, I have not tried Begin/EndWrite. I read the MSDN article but to be sure, testing these out would satisfy Async writing?
|
|
|
|
|
I am trying stop a console and then wait for it to close and then start it again. But my while loop is not working correctly. Can someone help me with what I am doing wrong? Thanks
if (Properties.Settings.Default.daily1 == true)
{
IntPtr serverHandle = FindWindow(null, Properties.Settings.Default.locServer1);
stopserver(Properties.Settings.Default.locServer1, btnStart1, btnStop1);
while (serverHandle != null)
{
}
startserver(Properties.Settings.Default.locServer1, btnStart1, btnStop1);
}
|
|
|
|
|
dwayne2700 wrote: But my while loop is not working correctly.
Offhand, I can see that if serverHandle is initialized with a non-null value, you'll be stuck in an infinite loop.
If your call to FindWindow succeeds, then serverHandle will be non-null, and you'll be stuck.
You'll have to come up with some other way of determining when the server is stopped successfully.
modified on Sunday, April 18, 2010 7:56 PM
|
|
|
|
|
You do realize that IntPtr is a struct, right? And that it can in no way be changed while the loop is running?
edit: saw your edit late
It appears that IntPtr has stuff build in to convert null to something more sensible for a struct, but it still should be IntPtr.Zero
|
|
|
|
|
Thanks guys, I am just losing my mind. Thanks for your help.
|
|
|
|
|
I published a C# Forms application to a directory on my server called ... /www/appBeta/ and the installation folder URL was /appBeta/
Everything worked and we decided to take the application live.
So I changed my publish folder to /www/app/ and the installation folder URL to /app/ and it seems that Visual Studio has cached the installation folder of Beta/
It correctly published the application to the /www/app/ directory, but the setup in that directory references the /appBeta/ directory.
I have shut down and restarted VS, I have rebooted my computer and I have gone through the publishing wizard again. The directories are correct in my project setting, but the published version has the OLD directory for the installation folder.
Why is it doing this? I have seen I can go back and manually change the installation URL, but it is frustrating to see my project settings are not applied. Where is this old directory getting cached and how to I remove it so I can do a clean build and publish with the correct settings?
|
|
|
|