Selko 님이 쓰신 글 :
: WNetUseConnection을 사용하여 네트워크 공유폴더를 붙였을 경우,
: Explorer로 탐색을 장시간 하지 않았을 때, net use 에 다시 접속 중 의 status가 확인됩니다.
: 그러면서 재접속 하는데 시간이 좀 걸리는데요.
:
: 1. 프로그램적으로 WNetUseConnection으로 맺은 세션 유지가 되고 있는 지 체크 할 수 있는 방법이 있는지
:
: 2. 장시간 미사용으로 접속이 다시 되는 케이스에 Window의 무엇이 이러한 접속을 시켜주는 것인지
:
By default, Windows suspends an inactive network connection to a shared folder residing on a server after 15 minutes however; you can modify this setting through Group Policy settings. When a session is suspended and the client computer resumes its activity the network connection is automatically re-established. Still, some users find it annoying to see red marks on mapped network drives in Windows Explorer.
The Group Policy security setting allows you to determine the amount of continuous idle time that must pass in a Server Message Block (SMB) session before the session is suspended due to inactivity. The default setting is not defined, which means that the system suspends a session after 15 minutes of idle time for connections to servers’ shares and the setting remains undefined for workstations.
To configure this setting on a single Windows computer, open the Local Group Policy Editor snap-in by typing gpedit.msc in the Start search text box and pressing enter.
•Go to Local Computer Policy/Computer Configuration/Windows Settings/Security Settings/Local Policies/Security Options node.
•Double click Microsoft network server: Amount of idle time required before suspending a session
•In the text field provided under Disconnect when idle time exceeds:, enter the number of minutes
•Then click Apply and OK.
Note, that a value of 0 means to disconnect an idle session as quickly as is reasonably possible. The maximum value is 99999, which is 208 days; in effect, this value disables the policy.
http://blogs.msdn.com/b/openspecification/archive/2013/03/19/cifs-and-smb-timeouts-in-windows.aspx
http://blogs.msdn.com/b/openspecification/archive/2013/03/27/smb-2-x-and-smb-3-0-timeouts-in-windows.aspx