Results 1 to 6 of 6

Thread: Can Server does the disconnection

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    12
    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
    David

  2. #2
    Guest

    Cool

    Try this in your ASP.

    <% Session.Abandon %>

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    12

    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

    David

  4. #4
    Guest
    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.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    12

    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.


    David

  6. #6
    Guest
    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
    Code:
    session.abandon
    or
    Code:
    session.timeout=0
    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
  •  



Click Here to Expand Forum to Full Width