• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

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
0
pete_c
Asked:
pete_c
1 Solution
 
Gregory MillerGeneral ManagerCommented:
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
0
 
manihopeverCommented:
just do a response.end in where you want to disconnect them.

mani.v
0
 
makerpCommented:
session.abandon
response.end

also switch connection keep-alives off in IIS admin
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
pete_cAuthor Commented:
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.
0
 
makerpCommented:

but switching off keep-alives and calling response.end will terminate any connection as when you call response.end the server will finish with the script and close the underlying socket with the client
0
 
pete_cAuthor Commented:
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.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now