Link to home
Start Free TrialLog in
Avatar of pete_c
pete_c

asked on

Disconnect a client with ASP?

Hi,

Is it possible to disconnect a client from the server-side, using ASP? I want to write the response, flush it, then disconnect the client without waiting for the IIS connection time-out to take effect. I don't think there is a way to do this but I'd be very happy to be proved wrong.

Pete
Avatar of Gregory Miller
Gregory Miller
Flag of United States of America image

You can not physically disconnect the client but you can end their session by using the Session.Abandon method. If you want to clear the screen of current content you could also redirect to another page immediately after and this should solve.

Good Luck,
-greg
Avatar of manihopever
manihopever

just do a response.end in where you want to disconnect them.

mani.v
Avatar of Paul Maker
session.abandon
response.end

also switch connection keep-alives off in IIS admin
Avatar of pete_c

ASKER

Thanks everyone.

Session.Abandon just wipes out any session variables. Likewise, Response.End will just stop processing of the current script. Switching off http keep-alives will result in the IIS-determined connection time-out being honoured but I need to programmatically disconnect the client from the server when I choose, in a way equivalent to being able to set Response.isClientConnected to False. None of the above really does that.
ASKER CERTIFIED SOLUTION
Avatar of Paul Maker
Paul Maker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pete_c

ASKER

I'm sure that's right - it's just not working as I would expect in the web app we're developing. I guess we'll have to look elsewhere for the answer to our particular problem. The points are yours.