|
-
Nov 28th, 2000, 03:29 PM
#1
Thread Starter
New Member
Hi, could you help in confirming if ASP server itself can do the disconnection from a specific client ?
If yes, what are the ASP statements in VBscript ?
if no, why?
suppose:
If IsClientConnected Then
'Do something
Else
'Do something else
End If
- This is CHECKING whether the CLIENT itseft disconnect from server, NOT the server does it.
- I wonder how to code in order to make the server do the disconnection whenever it does not allow the client to access the server pages anymore.
- Thanks
-
Nov 28th, 2000, 04:37 PM
#2
Try this in your ASP.
<% Session.Abandon %>
-
Nov 29th, 2000, 12:39 PM
#3
Thread Starter
New Member
Can Server does the disconnection
Thank, MadWorm
But, Session.Abandon seems just work for IE or Netscape, and not for other UserAgents.
Here is what I am doing:
(1) I have a VB application connects, through API , to ASP Server page.
(2) This Server page (ASP) has, besides, two task to do:
(i) Testing to know if the Client disconnects from the server
(ii) The server itself does the disconnection.
I ever tried session.Abandon, and it does not work
Correct me if I am wrong anyhow !
Thanks
-
Nov 30th, 2000, 03:18 AM
#4
DavidBG,
I'm stumped. The only way I know of to disconnect from server is session.abandon. I've never connected via API, does it communicate via HTTP? Can you post some code.
-
Dec 4th, 2000, 09:15 AM
#5
Thread Starter
New Member
Can Server does disconnection ?
Hi, MadWorm
I appreciate much your discussion. Here are some code within what I am doing in VB. It connects thru API to HTTP
hSession = InternetOpen(scUserAgent, _
INTERNET_OPEN_TYPE_DIRECT, "", "", 0&)
hConnection = InternetConnect(hSession, txtServerName, _
iPort, txtUserName, txtPassWord, _
INTERNET_SERVICE_HTTP, 0, 0)
hRequest = HttpOpenRequest(hConnection, "POST", _
"/myASPfile.asp?Texttosend", "", "", _
0, 0, 0)
bSendRequest = HttpSendRequest(hRequest, sHeader,
lngHeaderLen, sOptional, lngOptionalLen)
These functions are from API that is attached as VB module.
And on server side, myASPfile.asp is
<%
...
...
...
...
(1)
' --To test if the IP is 13.456.789 I want the server
' --disconnects from this client
Dim clientIP
clientIP = request.servervariables("remote_addr")
If clientIP = "123.456.789" Then
'--the code I want to disconnect
End If
(2)
'-- In the same page, If I want testing client's doing the
'-- disconnection.
If IsClientConnected Then
'-- Do nothing OR other statement
Else
'-- Delete this client ID from database
End If
But (2) does not work. It never returns FALSE for this IF
condition when the client closes the VB browser. Thus, the client ID is not deleted from database as expected.
-
Dec 6th, 2000, 05:04 PM
#6
DavidBG
Sorry, I'm fresh out of ideas, I would have thought where you have,
'--the code I want to disconnect
if you put in either or that would be the end of the session. Has anyone else got any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|