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
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.