Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
NT
apps
dfs
dns
domain
dsmnfpnw
embedded
fsft
mail
misc
oemdsp.preinstall
personalfax
print
protocol.ipx
protocol.misc
protocol.ras
protocol.routing
protocol.tcpip
registry
setup
terminalserv.app.
terminalserv.client
terminalserv.connectivity
terminalserv.domain
terminalserv.misc
terminalserv.prot.rdp
terminalserv.prot.tcpip
terminalserv.setup
terminalserv.user
windowsnt.wntsee
  
 
date: Wed, 24 May 2006 15:08:36 -0400,    group: microsoft.public.windowsnt.terminalserver.misc        back       


Detecting a lost connection   
I'm working on an application that is running on a Windows 2003 Terminal 
Server.  It needs to detect that the client has lost the connection and take 
an appropriate action.  I've set up a thread that periodically calls 
WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, 
WTSConnectState, ...).  This works, but not in a timely manner.  In tests, 
it typically takes upwards of 45 seconds for function to return 
WTSDisconnected.

How can an application detect that the client has become disconnected in a 
timely manner?

Thanks,
--David
date: Wed, 24 May 2006 15:08:36 -0400   author:   David Ehrlich

Re: Detecting a lost connection   
Could you not use the Winsock API, if you know what port the connections are 
on, enumerate them?  This will tell you when the clients are disconnected by 
the state of the sockets.

You could see this by using the NetStat -n at the command prompt.

Of course if it's multiple terminal servers using clustering or someother 
technology it will not do the job.

Regards,

Mike.

"David Ehrlich"  wrote in message 
news:uNHBnV2fGHA.2172@TK2MSFTNGP04.phx.gbl...
> I'm working on an application that is running on a Windows 2003 Terminal 
> Server.  It needs to detect that the client has lost the connection and 
> take an appropriate action.  I've set up a thread that periodically calls 
> WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, 
> WTSConnectState, ...).  This works, but not in a timely manner.  In tests, 
> it typically takes upwards of 45 seconds for function to return 
> WTSDisconnected.
>
> How can an application detect that the client has become disconnected in a 
> timely manner?
>
> Thanks,
> --David
>
>
date: Wed, 31 May 2006 13:30:49 +0100   author:   Mike

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us