Writing files through windows share fails

  • Thread starter Thread starter Lenard Gunda
  • Start date Start date
L

Lenard Gunda

Hello!

I have created a program, that receives files, and then stores them locally
for later access. This program is run on a Windows 2000 Server computer as a
system service. Some of the files also need to be copied over to another
computer, that is running Windows 2000 Professional version. This goes all
right for some time, but then I start receiving the following error.

IOException: No more connections can be made to this remote computer at this
time because there are already as many connections as the computer can
accept.

Currently, I am using FileInfo.CopyTo method to relocate the file to the
remote computer, by using windows shares. But I have also tried wiriting the
file there with FileStream (since I have it in memory), but that too causes
the above error after some time.

I guess this has something to do with the operating system being a
workstation version, which has probably a limited number (10?) of
connections available. I just don't know why the connections are not closed
and reused. I tested the program with Task Manager, to see if any handles
are leaking, but they are not.

What could be a solution to this situation?

Thanks

-Lenard
 
Is your application the only one accessing the win 2k pro box? If not other
people or apps could be causing the connections to max out. One way to tell
for sure would be to restart the service when the error occurs and see if it
takes a bit for it to occur again or if it starts right away when the
service restarts.

--
Thanks
Wayne Sepega
Jacksonville, Fl


"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
 
Actually it isn't the only one accessing the remote machine.

We checked the 2k pro machine, and there are other users accessing it by
using Windows shares. Could it be that the other users who access it, take
up the windows sharing slots (if there is such a limit), and my service
program is blocked out?

Would it help, if the program would open a file on the remote machine when
it starts, and keep it open until it stops, thereby reserving for itself a
session?

-Lenard
 
Defiantly could be the other users and there is defiantly a share limit on
PRO versions of the OS, I believe it's 10 as you stated before. As far as
keeping an open file, sounds like it should work, but I don't know for sure.

Wayne
 
Open a command shell and issue the "net session" command to get the number
of sessions (limit 10 on workstations) and their remote (client) computer
name.

Willy.
 
Back
Top