Solved

Disconnect a client with ASP?

Posted on 2002-03-28
6
245 Views
Last Modified: 2012-06-27
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
Comment
Question by:pete_c
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 11

Expert Comment

by:Gregory Miller
ID: 6902200
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
 
LVL 2

Expert Comment

by:manihopever
ID: 6902295
just do a response.end in where you want to disconnect them.

mani.v
0
 
LVL 10

Expert Comment

by:makerp
ID: 6902300
session.abandon
response.end

also switch connection keep-alives off in IIS admin
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:pete_c
ID: 6902389
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
 
LVL 10

Accepted Solution

by:
makerp earned 20 total points
ID: 6902400

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
 

Author Comment

by:pete_c
ID: 6902659
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question