Chat room key technology [user disconnection] Processing

Source: Internet
Author: User
Tags split
Chat room in the chat room, processing user disconnection is a thorn hand problem, especially on the free site, if blindly rely on Global.asa, when the trigger
Session_onend,application_onend, is an uncertain number, in the design, reasonable arrangement will bring unexpected benefits.
So what's the easiest way to deal with user disconnection?
After testing, the author has the following methods:
Chat room with N application ("User" & N) to save the user name, and then use Application ("Timebegin") to save each user's logon time, with
When the user log in with the session ("Timerbegin") to save the logon time (timer), set the refresh time in the speech area of n seconds, each refresh will be session
("Timebegin"), while determining whether timer-application ("User" &session (UserID)) is >n seconds, and if so, the user does not
Automatic refresh means that the application ("user" &n) can be set to a null value and then prompted that the user has exited.
Part of the code:
Total = Application ("allpeople") ' Number of chats
Aryhuman = Split (Total, ";")
For i = LBound (Aryhuman) To UBound (Aryhuman)-1
If Application ("User" & i) = "online" Then
if int (timer)-Int (Application ("Timebegin" & i)) > Then
Application ("User" & I) = ""
temp = Aryhuman (i)
Aryname = Split (temp, ",")
Hrefname = aryname (0)
for j = LBound (Aryhuman) To UBound (Aryhuman)-1
If Application ("User" & j) = "Online" Then
Application ("Content" & j) = "<font color= #000000 >" Announcements "" &hrefname& "</FONT>" & "<font Color= #F08000
> "&" Disconnection ... "&" </font><font color = #000000 class=p9> "&" < "& Time () &" ></f Ont><br> "& Application
("Content" & j)
End If
Next
End If
End If
Next
%>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.