Kevin - The chat comm. goes through CF as well. The process is pretty simple so far.
When you join, you get added to a table and everyone else in that table gets a new row in a separate table that signifies an event (USER_ADDED in this case). Each client then calls a cfc function once per minute which just loops until that client's events row isn't empty. If it's not empty ( or it's looped for a specified timeout) it returns the recordset to the client. The client acts on the event and then sends out a new request for events. So I have a function that is being called once every minute by every client. This gives me a case where a client has issued the request, but closes the browser (unloads the flash movie) before the server has had a chance to respond. I was hoping to catch this somehow and use it to end the session, which ultimately just deletes the user and any pending events for him/her from the db. I'm going to venture a guess and say that the server doesn't know the client isn't there, and just sends the response out anyway. John On Jun 14, 2007, at 5:22 PM, Kevin Aebig wrote: > How are you doing the actual chat communication? If you're using > either XML sockets or FMS, than you can trigger the notification > from there... > > !k > > -----Original Message----- > From: John Robinson [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 14, 2007 2:01 PM > To: CF-Talk > Subject: Re: Using sessions with Flash Remoting > > On Jun 14, 2007, at 3:47 PM, Dave Watts wrote: > >>> Given that that is the case and I have no way of knowing the >>> browser closed, I have a function (defined in a .cfc) called >>> by flash that basically loops for a while and returns some >>> data (or it times out and then returns an empty record set). >>> As soon as I get this response, I send out a new request from >>> flash. So I'm thinking that whenever a client closes their >>> browser that they will be in the middle of this call, waiting >>> for a response. Make sense? I'm also guessing that there may >>> be an error thrown here when CF tries to return the results >>> to a client that doesn't exist anymore. Can I catch this error >>> in Application.onError and tell CF to end the session? >> >> I don't think you'll get an error here, actually. But even if you >> did, you >> don't really need to worry about killing the session, since the >> client won't >> make any subsequent requests. If you're calling this function >> frequently, >> you can set the session timeout to be very short, say five minutes. > > Actually in this case, I do need to kill the session. I'm building a > chat app. When a user leaves, I need to let the other users still > active in the chat know that this user has left. Essentially I'm > deleting them from a temp table in a db. Make sense? The only > indication I've found so far is onEndSession. I'm thinking if I get > an error, I will know the user isn't around and can force the session > to close, which should trigger my onEndSession event. > >> >>> This could probably be a new post, but what I'd really like >>> to learn is a decent way to monitor the events in >>> Application.cfc. As it stands, the browser window is closed, >>> so how do I view any trace/ debug statements coming from >>> those events? >> >> Use CFLOG to write them to a file. > > Great! Thanks! >> >> Dave Watts, CTO, Fig Leaf Software >> http://www.figleaf.com/ >> >> Fig Leaf Software provides the highest caliber vendor-authorized >> instruction at our training centers in Washington DC, Atlanta, >> Chicago, Baltimore, Northern Virginia, or on-site at your location. >> Visit http://training.figleaf.com/ for more information! >> >> This email has been processed by SmoothZap - www.smoothwall.net >> >> >> > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281267 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

