Re: Client Connection

From: Ppaps (papettip@euroforex.com)
Date: 12/06/02


From: "Ppaps" <papettip@euroforex.com>
Date: Fri, 6 Dec 2002 16:01:59 +0100


Hi Mike

I've got 2 question 4 u.
1) In this way could happen that the "StoreDate2" page erase the data of an
active connection ? (in this case the user that is browsing should be
reconfigured)
2) could a Form Post every 10 or 15 Seconds decrease the WebServer
Performance ?

Thanks
Paps

"Mike Moore [MSFT]" <michmo@online.microsoft.com> wrote in message
news:Qn$AEmNnCHA.2304@cpmsftngxa06...
> Hi Paps,
>
> I consider the following to be non-elegant since you have to leave a
> browser open somewhere. I tried creating an infinite loop on the server,
> using thread.sleep to pause between testing & purging the application
> variables. However, it caused some problems during my testing (it hung the
> application domain). So, I moved the timing function to the browser.
>
> - Setup the following two pages
> - Browse StoreDate1.aspx & click the button
> This sets the application variable for the user and displays the results
> - In a different browser window (even on a different machine), browse
> StoreDate2.aspx & type "Erase" in the text box
>
> This will post the page to the server every 10 seconds. On the server, it
> will look for any application time stamps that are more than 15 seconds
old
> and delete the related application variables.
>
> *** StoreDate1.aspx
> Add two text boxes and a button
>
> *** StoreDate1.aspx.vb
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> Try
> TextBox1.Text = Application(User.Identity.Name) & " -- " &
> Application(User.Identity.Name & "_Time")
> Catch
> End Try
> Dim d As Date = Now()
> Application(User.Identity.Name) = "testing"
> Application(User.Identity.Name & "_Time") = d
> TextBox2.Text = d
> End Sub
>
> *** StoreDate2.aspx
> Add a text box and this code:
> <SCRIPT LANGUAGE="javascript">
> window.setTimeout("Form1.submit()",10000);
> </SCRIPT>
>
> *** StoreDate2.aspx.vb
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> If TextBox1.Text = "Erase" Then
> Dim d As Date
> Dim diff As Long
> Dim s As String
> Dim AppKeys() As String = Application.AllKeys
> For Each s In AppKeys
> Try
> If "_Time" = Right(s, 5) Then
> d = Application(s)
> 'For testing, make it 15 seconds
> diff = DateDiff(DateInterval.Second, d, Now())
> If diff > 15 Then
> Application.Remove(Left(s, Len(s) - 5))
> Application.Remove(s)
> End If
> End If
> Catch
> End Try
> Next
> Response.Write("Last cleanup was at " & Now().ToShortDateString &
> " " & Now().ToLongTimeString & "<br>")
> Else
> Response.Write("NO cleanup<br>Last check was at " &
> Now().ToShortDateString & " " & Now().ToLongTimeString & "<br>")
> End If
> End Sub
>
> *** End of sample code
>
>
> Thank you, Mike Moore
> Microsoft, ASP.NET
>
> This posting is provided "AS IS", with no warranties, and confers no
rights.
>
> --------------------
> >Content-Class: urn:content-classes:message
> >From: "PPaps" <papettip@euroforex.com>
> >Sender: "PPaps" <papettip@euroforex.com>
> >Subject: Client Connection
> >Date: Thu, 5 Dec 2002 05:00:23 -0800
> >Lines: 13
> >Message-ID: <032701c29c5e$45c236d0$89f82ecf@TK2MSFTNGXA01>
> >MIME-Version: 1.0
> >Content-Type: text/plain;
> > charset="iso-8859-1"
> >Content-Transfer-Encoding: 7bit
> >X-Newsreader: Microsoft CDO for Windows 2000
> >Thread-Index: AcKcXkXCnfLEIJqZQpym5Up4GT69zQ==
> >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
> >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
> >NNTP-Posting-Host: TK2MSFTNGXA01 10.40.1.47
> >Path: cpmsftngxa09!cpmsftngxa10!cpmsftngxa06
> >Xref: cpmsftngxa09 microsoft.public.dotnet.framework.aspnet.security:3268
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
> >
> >When a user logon to my web I save some information on a
> >Application variable ex : Application[UserName] = MyInfo;.
> >The user can of course open more then one session and the
> >user information is also avaible in a WebService for
> >other server that need this information.
> >My problem is :
> >When I can cancel this information becouse the user is
> >logoff ?
> >How I can understand when the user close all his
> >sessions ?
> >
> >Hope you understand the problem (else let me know ;))
> >Thanks Paps
> >
>



Relevant Pages

  • Re: VarPtr and passing variables by ref
    ... group who I can personally vouch for has many, ... First is was Bob, which was a foolish thing to do because he knows his ... web presense which Bob and Mike don't...and this makes them targets for your ... |> Private Sub Test ...
    (microsoft.public.vb.general.discussion)
  • Re: HW for SBS 2008 - advice?
    ... Mike wrote: ... Yesterday I moved my Backup Exec install off the C drive partition, ... As for server speed, given enough RAM always put your money into the ... with a six disk array (36Gb 15K drives), ...
    (microsoft.public.windows.server.sbs)
  • Inet -> Winsock : Must close server for reply
    ... Inet control to connect in HTTP to the server which is actually not a ... Private Sub Winsock1_ConnectionRequest ... Dim sCommand As String ...
    (microsoft.public.vb.general.discussion)
  • Inet -> Winsock : Must close server for reply
    ... Inet control to connect in HTTP to the server which is actually not a ... Private Sub Winsock1_ConnectionRequest ... Dim sCommand As String ...
    (microsoft.public.vb.winapi)