Connect vs Disconnect with UserEvent.SYNCHRONIZATION_CHANGE

I'm using the UserEvent.SYNCHRONIZATION_CHANGE event to determine when the current user connects or disconnects from a room. Since SYNCHRONIZATION_CHANGE fires for both loging in and logging out, what is the best way to distinguish between the connecting and disconnecting?http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/events/UserEvent.html#SYNCHRONIZAT ION_CHANGE

Thanks for your response. I have two quesitons.
1) I wasn't able to find the example you mentioned (sharedModel/SharedManager). I found sampleApps/SharedModel/*, but didn't see SharedManager classes in there. Where can I find these classes?
2) I misunderstood you when you said "You can look for isSynchronized property in your  ConnectSession/CollectionNode". I started watching cSession.isSynchronized, which works for the first time you enter a room, but if you leave a room and enter another, cSession.isSynchronized does not do what I'm expecting (true = logging in, false = logging out). Which isSynchronized should I be monitoring? Here's an example of what I'm currently doing and some associated output that is not doing what I expect. I know that looking at cSession.isSynchronized, but could you show me how to modify my example to work correctly?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:rtc="AfcsNameSpace"
    layout="horizontal"
    creationComplete="init()">
    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import com.adobe.rtc.events.UserEvent;
            protected static const roomUrlBase:String = "https://connectnow.acrobat.com/MYACCOUNT/"
            protected function init():void {
                cSession.userManager.addEventListener(UserEvent.SYNCHRONIZATION_CHANGE, syncChange);
            protected function syncChange(event:UserEvent):void {
                trace(">> syncChange cSession.isSynchronized = " + cSession.isSynchronized);
            protected function enterRoom():void {
                trace(">> Clicked 'Enter Room' button. Entering room: " + roomField.text);
                trace(">> enterRoom before anything - cSession.isSynchronized = " + cSession.isSynchronized);
                cSession.roomURL = roomUrlBase + roomField.text;
                cSession.login();
            protected function leaveRoom():void {
                trace(">> Clicked 'Leave Room' button");
                trace(">> leaveRoom before anything - cSession.isSynchronized = " + cSession.isSynchronized);
                cSession.logout();
        ]]>
    </mx:Script>
    <mx:TextInput id="roomField"/>
    <mx:Button label="Enter Room" click="enterRoom()"/>
    <mx:Button label="Leave Room" click="leaveRoom()"/>
    <rtc:ConnectSessionContainer id="cSession" autoLogin="false" width="100%" height="100%" >
        <rtc:authenticator>
            <rtc:AdobeHSAuthenticator userName="Guest"/>
        </rtc:authenticator>
        <rtc:Roster width="250" height="250"/>
    </rtc:ConnectSessionContainer>
</mx:Application>
Output:
>> Clicked 'Enter Room' button. Entering room: myfirstroom1
>> enterRoom before anything - cSession.isSynchronized = false
>> syncChange cSession.isSynchronized = true
>> Clicked 'Leave Room' button
>> leaveRoom before anything - cSession.isSynchronized = true
>> syncChange cSession.isSynchronized = false
>> Clicked 'Enter Room' button. Entering room: myfirstroom2
>> enterRoom before anything - cSession.isSynchronized = false
>> syncChange cSession.isSynchronized = false

Similar Messages

  • IPhone 4s keep connecting then disconnecting with new MBA

    Hi,
    New MBA i5/4g/128 arrived this afternoon. During few hours of setting all my stuff, everything works just fine.
    But when I try to connect my iPhone 4s with a official cable, it keeps connecting then disconnecting(about 2 times per second) and won't stop.
    Is there anyone met the same issue? please help. Thanks!

    Thanks for the reply
    I've tried 2 cables at home. 1 is a offical cable and another one is a 3rd party cable, both of them didn't work, and both of them work perfectly with other PCs.
    After read your reply, I decide to try another 3rd party cable at office, it worked.
    No idea why, but maybe MBA choose cable more sensitively?
    Anyway thanks a lot and have a nice day!

  • When booting up, the bluetooth connects and then disconnects with my trackpad 3 or 4 times then i get a gray cover over the desktop that drops from top to bottom then a window that tells me to use the power button to do a forced shutdown.

    when booting up, the bluetooth connects and disconnects with my trackpad 3 to 4 times and then i get a gray sheet that drops down from the top to bottom of the desktop then a box in the center that tells me to use the power button to do a forced shutdown. wireless keyboard connects with no problem. went to the apple store and they replaced the bluetooth card. still have the same problem. removed the batteries from the trackpad, strted up and no problem connecting with wireless mouse and keyboard. anyone else experience this?

    This could be a software/state problem or a hardware problem.  Here are steps to resolve the former.
    http://support.apple.com/kb/TS2570
    https://discussions.apple.com/docs/DOC-5282

  • Windows won't install USB device...infinite loop of connect and disconnect

    I've been very happy with my Ipod purchases over the years but this one is the worst problem I have ever had. Purchased an 8gb Ipod Nano 3rd gen for the wife as a Xmas present and went to install it on my PC today but no luck whatsoever. The PNP manager seems to go into an infinite loop of connect and disconnect with the odd "Itunes has found a corrupt player ...." message but the device won't stay on the PC long enough as it promptly disconnects from the PC again!
    My other 3 Ipods all connect and work quite happily on this PC, I've tried a few of the other "solutions" that seem to fix other "problems" but as the device does not stay connected for long enough I can't do anything with it!
    Has anyone else had this problem and been able to fix it? If so, what did you do to correct the problem?
    thanks
    Marty

    Thanks, tried that and much more - a very frustrating process.
    I've just posted this on another thread...
    I've tried unplugging everything and it still didn't work (I only have a USB printer, USB 1.1 hub and a USB phone connected). Funnily enough though connecting it to the USB 1.1 hub it works OK - go figure. Connecting directly to a USB 2 connector either on the front or rear panel and my PC goes into the connect/disconnect loop! My 1st and 2nd gen Ipod nano's and my Shuffle all happily connect to the USB 2 connectors on the front panel but the 3rd gen one does not want to know.
    I think that Apple have got something seriously wrong here and it would be nice if it was acknowledged and a proper fix applied.

  • I have a 1TB WD external hard disk, which suddenly cannot be detected in my system. When i connect the hardisk to the macbook, the disk appears and immediately disconnects with the message "Disk not properly ejected". Any advice ?

    I have a 1TB WD external hard disk, which suddenly cannot be detected in my system. When i connect the hardisk to the macbook, the disk appears and immediately disconnects with the message "Disk not properly ejected". Any advice ?

    verify on another Mac if the same
    WD is having issues with mavericks as you can see on the WD forum, did you install any WD software (never do that) when you connected the drive for the first time?
    possible issue is a dead SATA bridge card or the new WD firmware w/ Mavericks.
    SATA card issue
    Your dead external hard drive is likely fine! Great hope for your 'faulty' external HD
    http://community.wd.com/t5/External-Drives-for-Mac/bd-p/passport_mac
    verify on another Mac if all possible

  • Since upgrading to Mavericks, I have been unable to sync devices (specifically ipad mini and iphone 4s) to my MId 2013 Imac . They wil rapidly connect and disconnect, and I'm unable to do anything with the device. This happens with both USB ports.  Any su

    Since upgrading to Mavericks, I have been unable to sync devices (specifically ipad mini and iphone 4s) to my MId 2013 Imac . They wil rapidly connect and disconnect, and I'm unable to do anything with the device. This happens with both USB ports.  Any suggestions?
    MacBook Air, OS X Mountain Lion (10.9.1)

    Obviously, syncing an iOS device with iTunes over USB is still supported in Mavericks. Calendar and contact syncing with iTunes is no longer supported. That has nothing to do with your problem.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • IPod says connected,eject before disconnecting with a pict. Of the USB cable. It does this after its been charging and I can not access the menus. Any solutions?a

    iPod seems to be frozen. After it has been charing and I remove it foamy PC! It says "connected, eject before disconnecting" with a picture of the USC cable. I can not proceed with this on the screen. Should I reconnect to my pc and do something differently?

    Try to perform a hard reset of the iPod, which is about the equivalent of rebooting your PC.  To do this, first make sure the hold switch is in the Off position.  Then press and hold both the Select (Center) and Menu buttons together long enough for the Apple logo to appear.
    B-rock

  • After Safari 7.06 update, whenever I connect to RSA Juniper Network Connect, my internet connection get disconnected. It was an issue with old Safari versions. It was fixed around 6 months back with one of Safari update. But, now it is broken again.

    After Safari 7.06 update, whenever I connect to RSA Juniper Network Connect, my internet connection get disconnected. It was an issue with old Safari versions. It was fixed around 6 months back with one of Safari update. But, now it is broken again.
    Anybody experiencing the same problem and any suggestions to fix the issue.

    Hi ..
    Try this discussion >  Can't connect to Juniper VPN

  • My iphone4 when connected to any computer will not charge and is constantly connected and disconnected.  does the same with itunes.  Also i'm talking on the phone and all of a sudden the other person can not hear me.

    My iphone4 when connected to any computer will not charge and is constantly connecting and disconnecting.  It does the same with itunes so it doesnt really sync.  Also when talking to someone, all of a sudden they cant hear me.

    I'm having the same issue. I went to my local apple store and they could not work me into the genius bar so i made an appointment for tomorrow morning. The clerk did check the phone for the pink indicators at the top and bottom of the phone (where you plug in your USB or headphones) He said if you can see a pink indicator dot you may have gotten it wet, or had some sort of condensation in it, which could cause the plugs to not work.
    In regards to people not being able to hear you, i'm waiting for my appointment tomorrow for more news! I would recommend taking it into your local apple store for more answers.

  • Nortel VPN connects and disconnects immediately. Error 6699 with PPTP

    Hi All,
    I am using OS X Mavericks on my mac. I tried to connect to PPTP internet connection using the default client and paid clients like Shimo.I get connected and after a minute I get disconnected with 6699 error. I read a lot of discussions about this issue and I realised this issue exists from Pather days. Please help me out with this if you have a working solution.

    Hi, might try this after reading about that error, I think it may fix it...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.5, 10.6, 10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x/10.8.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    If using Wifi/Airport...
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
    Check your DNS numbers are good.

  • All iPhones constantly connecting and disconnecting from 2014 MacBook Pro with retina display

    So I have an iPhone 6, 4s, and 3gs, whenever I plug any of them into my MacBook pro they rapidly connect and disconnect. After about 20 seconds of doing this they trackpad and keyboard stop responding and won't be recognized until I restart the laptop.
    Just as more information I have used 5 or 6 different cables and it works fine with my LG G3 and every other usb device I use. I have iTunes updated to 12.0.1 and OSX updated to 10.10, and this has been happening for about 2 months or so. My iPhone 6 is running 8.1 but did this before, although with the first sync when I first got the phone it worked fine.
    Any information would be helpful
    Thank you

    I'm having the exact same issue with the new 2014 iMac 5K Retina i5. iPhone 5 and iPhone 5s both work flawlessly.

  • My iPhone connects and disconnects repeatedly with Macbook Pro

    As of this morning, everytime I connect my phone to my computer it rapidly connects and disconnects. After searching the web far and wide I've only come up with dead ends. Before today it worked fine, I don't think it's the cord because it works when i tried it with another computer and works when I charge my phone with the wall charger (which I'm forced to do now). Error messages have popped up like 0xE8000001 and 0XE8000065. If anyone could help that's be awesome.

    I had to restore the phone to factory settings. Turn it off (press & hold sleep/wake button) and then plug it it to your computer while pressing the home button. Even at that stage the phone might keep disconnecting and reconnecting occasionally. I acctually had to do it on a mac running 10.6.8. My laptop is on 10.7.3 and it would not stay connected long enought for the restore to finish. However, once it was done, my iphone was on 5.1.1 and working perfectly. Hope this helps.

  • Since installing Lion OS I'm having issues with my Wi-Fi connectivity.  It sometimes will disconnect with no reasons.

    Since installing Lion OS I'm having issues with my Wi-Fi connectivity.  It sometimes will disconnect with no reasons.

    Hi Ray, this has worked for a few...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    10.4 instructions...
    Is that Interface dragged to the top of Network>Show:>Network Port Configurations.
    If using Wifi/Airport...
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
    For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    Click OK.

  • Help! My iPhone 4 with ios7's music player resets and plays in alphabetical order everytime it's connected or disconnected to any cord anywhere! Anyone know why? Or how to resolve this issue? ?

    This is driving me crazy. The player resets mid song, whenever it's connected or disconnected to any device (i.e. car, desktop, dock) and proceeds to begin playing my entire music library in alphabetical order. That 1st song is getting pretty annoying. Does anyone else have this issue? Is there any fix? I haven't found any settings or preferences for this so I'm a bit stumped and very frustrated.

    Yes, I'm having that same problem.  I had the same problem in iOS 6, but could get around it by starting the song I wanted before connecting the phone - annoying to have to do, but at least it worked.  In iOS 7, it appeared to be fixed, but since updating to 7.02 that no longer works.  In fact, not only does it play the first song (yes, it's getting VERY annoying), but when I then choose the song I want, the first song it STILL displayed on my car radio.
    To make it worse, the Music app insists on keeping Repeat All turned ON.  If I disable it, the next time I connect there's that first song and Repeat All turned on again.
    So frustrated that I just don't listen to music on my phone anymore in the car.  I should also mention that displaying the wrong song info has never happened before 7.02, but whether or not that was the cause I don't know.

  • When i plug the USB for my iPad into my computer it will connect then disconnect over and over again untill i wiggle the usb around alot. This is happening to all my ports. But not on the other computer.

    Hi. Whenever i plug my iPad (Happens with ipod and iphone too) to my computer usb for itunes is will connect, then disconnect over and over again. It has happened for a long time but doesnt happen on my other computer. how do i fix this?

    If you have a spare cable, try using that.  But the fact that this doesn't happen on your other computer (I assume using the same old cable) leads me to conclude that something else is at work.  Maybe even the "bad" computer.

Maybe you are looking for