Writing files through windows share fails

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lenard Gunda

    Writing files through windows share fails

    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


  • Wayne

    #2
    Re: Writing files through windows share fails

    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

    "Lenard Gunda" <arthur.darkhol me@vipmail.hu> wrote in message
    news:eihqgaeCFH A.392@TK2MSFTNG P14.phx.gbl...[color=blue]
    > Hello!
    >
    > I have created a program, that receives files, and then stores them[/color]
    locally[color=blue]
    > for later access. This program is run on a Windows 2000 Server computer as[/color]
    a[color=blue]
    > 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[/color]
    this[color=blue]
    > 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[/color]
    the[color=blue]
    > file there with FileStream (since I have it in memory), but that too[/color]
    causes[color=blue]
    > 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[/color]
    closed[color=blue]
    > 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
    >
    >[/color]


    Comment

    • Lenard Gunda

      #3
      Re: Writing files through windows share fails

      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


      "Wayne" <MeNotYou@commu nity.nospam> wrote in message
      news:uhUu%23keC FHA.1264@TK2MSF TNGP12.phx.gbl. ..[color=blue]
      > 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
      >
      > "Lenard Gunda" <arthur.darkhol me@vipmail.hu> wrote in message
      > news:eihqgaeCFH A.392@TK2MSFTNG P14.phx.gbl...[color=green]
      >> Hello!
      >>
      >> I have created a program, that receives files, and then stores them[/color]
      > locally[color=green]
      >> for later access. This program is run on a Windows 2000 Server computer
      >> as[/color]
      > a[color=green]
      >> 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[/color]
      > this[color=green]
      >> 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[/color]
      > the[color=green]
      >> file there with FileStream (since I have it in memory), but that too[/color]
      > causes[color=green]
      >> 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[/color]
      > closed[color=green]
      >> 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
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Wayne

        #4
        Re: Writing files through windows share fails

        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


        "Lenard Gunda" <arthur.darkhol me@vipmail.hu> wrote in message
        news:uTToVxeCFH A.3732@TK2MSFTN GP14.phx.gbl...[color=blue]
        > 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
        >
        >
        > "Wayne" <MeNotYou@commu nity.nospam> wrote in message
        > news:uhUu%23keC FHA.1264@TK2MSF TNGP12.phx.gbl. ..[color=green]
        > > 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[/color][/color]
        if[color=blue][color=green]
        > > 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
        > >
        > > "Lenard Gunda" <arthur.darkhol me@vipmail.hu> wrote in message
        > > news:eihqgaeCFH A.392@TK2MSFTNG P14.phx.gbl...[color=darkred]
        > >> Hello!
        > >>
        > >> I have created a program, that receives files, and then stores them[/color]
        > > locally[color=darkred]
        > >> for later access. This program is run on a Windows 2000 Server computer
        > >> as[/color]
        > > a[color=darkred]
        > >> system service. Some of the files also need to be copied over to[/color][/color][/color]
        another[color=blue][color=green][color=darkred]
        > >> 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[/color]
        > > this[color=darkred]
        > >> 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[/color][/color][/color]
        the[color=blue][color=green][color=darkred]
        > >> remote computer, by using windows shares. But I have also tried[/color][/color][/color]
        wiriting[color=blue][color=green]
        > > the[color=darkred]
        > >> file there with FileStream (since I have it in memory), but that too[/color]
        > > causes[color=darkred]
        > >> 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[/color]
        > > closed[color=darkred]
        > >> and reused. I tested the program with Task Manager, to see if any[/color][/color][/color]
        handles[color=blue][color=green][color=darkred]
        > >> are leaking, but they are not.
        > >>
        > >> What could be a solution to this situation?
        > >>
        > >> Thanks
        > >>
        > >> -Lenard
        > >>
        > >>[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Willy Denoyette [MVP]

          #5
          Re: Writing files through windows share fails

          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.


          "Lenard Gunda" <arthur.darkhol me@vipmail.hu> wrote in message
          news:eihqgaeCFH A.392@TK2MSFTNG P14.phx.gbl...[color=blue]
          > 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
          >[/color]


          Comment

          Working...