Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WNetAddConnection2

WNetAddConnection2

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nic Oughton
    wrote on last edited by
    #1

    Hi, I am using the WNetAddConnection2 function to create a user connection on a Windows2000 server. The connection is not persistent but I need it to remain active for the lifetime of a component on the client PC. What is currently happening is that after 15 minutes idle time the server is deleting the clients connection. I could run a timer, which calls the WNetAddConnection2 again. However, apart from needlessly running a Windows timer, this only has an effect if the connection has already been deleted. So as we don't know the exact period between creation and idle time deletion there maybe a period before the timer tick where the client is disconnected. Does anyone have any ideas on how this connection can be kept active until the component that created the connection wants to terminate it ? Thanks in advance. Nic :confused: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nic.oughton@trikon.com

    D 1 Reply Last reply
    0
    • N Nic Oughton

      Hi, I am using the WNetAddConnection2 function to create a user connection on a Windows2000 server. The connection is not persistent but I need it to remain active for the lifetime of a component on the client PC. What is currently happening is that after 15 minutes idle time the server is deleting the clients connection. I could run a timer, which calls the WNetAddConnection2 again. However, apart from needlessly running a Windows timer, this only has an effect if the connection has already been deleted. So as we don't know the exact period between creation and idle time deletion there maybe a period before the timer tick where the client is disconnected. Does anyone have any ideas on how this connection can be kept active until the component that created the connection wants to terminate it ? Thanks in advance. Nic :confused: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nic.oughton@trikon.com

      D Offline
      D Offline
      Daniel Lohmann
      wrote on last edited by
      #2

      What is about just "using" the connection every, lets say, 10 minutes. (List the directory, access some file or, if it is not a connection to an UNC share, call an API that routes over IPC$ like remote registry access or the SCM API.) Then the system should not detect it as beeing idle :-D -- Daniel Lohmann http://www.losoft.de (Hey, this page is worth looking! You can find some free and handy NT tools there :-D )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups