Stream Connection switching

i made video gallery with "Live" button
problem is connection switching
when click on live button i want this code in my script
var nc:NetConnection = new NetConnection(this);
nc.connect("rtmpt://localhost/live");             
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(defaultBuffer);
video_holder.videoClip.attachVideo(ns);
video_holder.attachAudio(ns);
video_holder.videoClip.smoothing = true;
ns.play('livestream');
and on any click thumbnail i want this code.
var nc:NetConnection = new NetConnection(this);
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(defaultBuffer);
video_holder.videoClip.attachVideo(ns);
video_holder.attachAudio(ns);
video_holder.videoClip.smoothing = true;
ns.play(toLoad);  //toLoad get the flv file        
so please tell me any if else condition or any other condition for connection switching.
you also see in attach txt file
from Line 122 to 142 is the required code

Thankyou shmoove. The code is here.
The server is setup to send information every 3 seconds to the client (upon client request,, which is working fine). For your reference,, the same code works perfectly fine with a Series 60 (midp2.0) phone, and so does the server. except that i use a SocketConnection for the midp 2.0 phone. For the very reason that midp 1.0 does not support the SocketConnection, i have to use a StreamConnection instead. the dataInputSream is bound with the StreamConnection object.
I think the StreamConnection is somehow not persistant ,, in the sense the connection is not maintained.
Please tell me whats wrong,
Thankyou,
Balaji.
public Alert alertConnBroken = new Alert("", "Due to weak wireless link, Connection to server lost. Please reconnect!!", null, AlertType.WARNING);
public String readString()
     String str = new String();
     while(true)
          try
               if((ch = (char) dataInputStream.read()) == -1)                   
                    display.setCurrent(alertConnBroken);
                    break;
               else
                  str = str + ch;
          catch(InterruptedIOException iioe)
               iioe.printStackTrace();
               break;
          catch (IOException ioe)
               ioe.printStackTrace();
               break;
            catch(EOFException eofe)                     
                eofe.printStackTrace();                                        
             break;
         catch (Exception e)
            e.printStackTrace();
             break;
     return str;     
     

Similar Messages

  • Hi, Can you help me I am running an iMac 10.7.5 and iPad 6.0.1 and a macair10.8.2. iCloud is syncing emails and notes but not photos. Photo streaming is switched on on the iMac. what do I need to do to stream photos?

    Hi, Can you help me I am running an iMac 10.7.5 and iPad 6.0.1 and a macair10.8.2. iCloud is syncing emails and notes but not photos. Photo streaming is switched on on the iMac. what do I need to do to stream photos?

    Hi you have basicly 2 Options.
    1 -if you Switch One fotostream on all 3 devices of yours which are working on the same apple id -all Fotos you Take with your iPad will be synchronized via icloud to the other 2 decvices ( w-lan and battery depending).
    2- If you select foots or a whole album in iPhoto on your air or iMac and choose than puplish --> fotostream --> new or existing event you can key in a friends mail. If this friend has iCloud and iPhoto ( for iMac or MacBook ) and click on the link in the email it will download this fotos in the fotostream section in iPhoto. If he has a iPad, iPhone,... It will do it in the foto app and if he doesn't have a iCloud account at all and you choose "public web site" while publishing he can see your fotostream on a website.

  • How to connect switch controls to float PLC items ?

    The AB PLC float items are 32 bits, but the LV boolean variables are 8 bits!
    So how can I connect switch controls to these float items???
    Thanks in advance

    Check this
    http://forums.lavag.org/Industrial-EtherNet-EtherNet-IP-t9041.html
    Best regards
    Siva
    [email protected]

  • Multiple Consumer Object per Streaming Connection in AIR2.0

    HI,
    we require streaming server setup for our project.
    We are trying to minimize number of connections to the streaming server.
    My query is "If we have multiple Consumer object instance with same channel and destination, will all the Consumer instances share the same streaming connection or for every Consumer object instance a new Connection is created?"
    Thanks in advacne for your support.
    Regards,
    Shailendra

    Thanks doghouseJim, appreicate
    I tried to substitute onStatus function with your code (metadata) and as a result I don't have reported  error anymore.
    However, for strange reason, once the flash goes into a html document the video is not loaded...
    any idea?
    Cheers

  • Stream connection throws IOException

    i am using a stream connection for the midp 1.0. The client logs into a server using a StreamConnection and all this is cool.
    But the application waits at the DataInputStream.read and then thows the IOException.
    my code is something like this,,
    while(true)
    if ((i = dataInputStream.read()) == -1)
    // some logic here
    the dataInputStream.read() throws the exception after approximately 7 to 8 seconds.
    anyone has an idea as to whats going wrong? why is the connection not being maintained.
    Thankyou,
    Balaji.

    Thankyou shmoove. The code is here.
    The server is setup to send information every 3 seconds to the client (upon client request,, which is working fine). For your reference,, the same code works perfectly fine with a Series 60 (midp2.0) phone, and so does the server. except that i use a SocketConnection for the midp 2.0 phone. For the very reason that midp 1.0 does not support the SocketConnection, i have to use a StreamConnection instead. the dataInputSream is bound with the StreamConnection object.
    I think the StreamConnection is somehow not persistant ,, in the sense the connection is not maintained.
    Please tell me whats wrong,
    Thankyou,
    Balaji.
    public Alert alertConnBroken = new Alert("", "Due to weak wireless link, Connection to server lost. Please reconnect!!", null, AlertType.WARNING);
    public String readString()
         String str = new String();
         while(true)
              try
                   if((ch = (char) dataInputStream.read()) == -1)                   
                        display.setCurrent(alertConnBroken);
                        break;
                   else
                      str = str + ch;
              catch(InterruptedIOException iioe)
                   iioe.printStackTrace();
                   break;
              catch (IOException ioe)
                   ioe.printStackTrace();
                   break;
                catch(EOFException eofe)                     
                    eofe.printStackTrace();                                        
                 break;
             catch (Exception e)
                e.printStackTrace();
                 break;
         return str;     
         

  • Connecting switches together

    hi,
    What is the best way to connect switch together (with 2960 switch)..cross or stright cable...up/down or normal port ?
    WAN ----Router 1 --- -SW1 ---- SW2
                                      |
                                      |
                                     SW3----SW4----SW5 (no vlan)---PC1
    all switch has up,down and normal port except SW5
    Does SW5 will support vlan if it is connect to a layer 2 switch (let s say sw5 is connected to port 5 of SW4 (and port 5 is VLAN 20 access mode...then trunk between SW3 and SW1))...is there any inheritance ?
    Hope, this time, this post will be post on the forum.
    Thanks for help,

    Hi Loic the wire between switch 4 and 5 shouldn't make a difference in terms of rj45 so long as it is auto set (which by default it is). If you want switch 5 to be vlan 20, configure vlan 20 there and the port on switch 4 must also have vlan 20. So long as either switch is tag or untag, but both configuration matching it will work fine.
    -Tom
    Please mark answered for helpful posts

  • Wireless Radio Connection - switches off

    My Wireless Radio Connection switches off after about 2-3 minutes.  Is there a setting I can adjust to lengthen this amount of time?  When it shuts off, all I have to do is FN5 to reconnect but I shouldn't have to do that every 3 minutes.  I have a T60.  Thank you.

    Assuming your're using a version of Windows, use the Device Manager and configure the Advanced Properties
    DISABLE /UNCHECK "ALLOW WINDOWS TO TURN OFF DEVICE TO CONSERVE POWER"
    Next, ensure all the PowerManager settings are set to a a Max Performance / Vid Presentation Profile but this doesn't necessarily ensure the WiFi NIC could be turned off if you or someone else has tuned the power profiles to disable NIC's after whatever period of time
    It doesn't hurt to verify within the BIOS PCI PowerMgmt IS ENABLED and the Smart CPU settings are activated.
    If the issue is still occurring then load an alnternate Operating system, Knoppix or SLAX Live BOOT CD's enable the loading and execution of a featured LINUX kernel with driver support for most Thinkpads since it seems te developers of the LIVE CD's use thinkpads themselves or MAC's, it is likely the latest Knoppix distro is compatible with your NIC and observe whether or not the issue still occurs / if so then you can most likely attribute it to an odd hardware issue and you should begin researching whether or not a BIOS upgrade or even Downgrade is a solution.
    Before flashing, it is worth taking note of the fact the intermittent power issues seem to be related to your Windows build and you should install a parallel installation of any compatible Windows version then install the barebones necessary drivers to determine if the power issues still occur on a freshly minted version of Windows.
    Also, determine whether or not your actual WiFi NIC is flashable, modern network adapaters have increased in complexity especially as a necessity of WOL and the Intel SLM features that more corporate purchasers demand thus NIC's have increased in complexity becoming more like mini VX systems with flashable firmware which may have merit as a solution if you isolate it to your hardware.
    Don't just sit there, take a second and use the Kudo's button to compliment the people who help you.

  • If 2 clients can't be neighbours can they establish a direct stream connection?

    I used to have 2 computers (connected over a strange network) that could not become neigbours in the same NetGroup!
    Because of that I am now exchanging the farID's trough the database similar to the Cirrus sample (I used to exchange it trough the NetGroup).
    But now I find that even a direct stream connection between the same computers is not really possible!
    So, if 2 clients can't be neighbours is there any chance they can establish a direct stream connection?

    no.  exactly the same kind of RTMFP connection is attempted between the two computers.  direct connections and group communications are just different kinds of flows over an RTMFP session.

  • If I delete all the pics n movies from camera roll.r they gonna b deleted from iCloud as well?n is photo stream connected to iCloud?

    If I delete all the pics n movies from camera roll.r they gonna b deleted from iCloud as well?n is photo stream connected to iCloud?

    Welcome to the Apple Community Hamza.
    Firstly, photo stream doesn't save videos, secondly, it may not have all your photos saved in it, it only keeps photos for 30 days.
    Back up your photos to a computer or online photo storage facility, before deleting them from your phone.

  • Increasing max-streaming-connections-per-session has slow acknowledge response?

    Our application is a Flex GUI with a WebLogic Server (BlaseDS) on a private network.  We were originally using IE 6, but have upgraded to IE 8.
    I am trying to use publish/subscribe messaging to monitor lengthy processes on the server and received incremental data.  With 1 such process everything works fine.  But we want to allow the user to subscribe to more than 1 message destination.  So I increased the "max-streaming-connections-per-session" (default is 1) in the services-config.xml file
         <channel-definition id="process-notification-streaming-amf"
              class="mx.messaging.channels.StreamingAMFChannel">
              <endpoint url=https://{server.name}:{server.port}/{context.root}/messagebroker/streamingnotificationamf"
              class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
              <properties>
                   <user-agent-settings>
                        <user-agent match-on="MSIE" kickstart-bytes="2048"
                             max-streaming-connections-per-session="3" />
                   </user-agent-settings>
              </properties>
         </channel-definition>
    If we leave max-streaming-connections-per-session as the default value of 1 and try to subscribe to another message destination we get an error indicating limit has been reached:
         [BlaseDS]Endpoint with id 'process-notification-streaming-amf' cannot grant streaming connection to FlexClient with id '7FFC82DE-etc ' because max-streaming-connections-per-session limit of '1' has been reached.
         We upgraded to IE8 as documentation indicates IE8 allows for an increase of max-streaming-connections-per-session, where IE 6 is limited to 1.  But increasing max-streaming-connections-per-session does not quite solve the problem.  We have 3 consumers; consumer1, consumer2, consumer3.  For each of these consumers, we add event listeners for MessageAckEvent.ACKNOWLEDGE and MessageEvent.MESSAGE.
         We call consumer1.subscribe().  When we receive the acknowledge message, we call consumer2.subscribe() (likewise with consumer3)
         The problem is it takes over 2 minutes to receive the acknowledge message from the call to consumer1.subscribe().  (With max-streaming-connections-per-session set to 1, the acknowledge message is received in a few seconds.)
         So, increasing max-streaming-connections-per-session removes the error about reaching a limit, but it appears to come with a cost of a big delay in a long delay on the call to subscribe?  Or is there something we are missing?

    I guess I will answer my own question.  Hopefully this will be useful to someone else in the future...
    The problem was coming from IE being limited to 1 connection by the registry.  The solution can be found at:
    http://support.microsoft.com/kb/282402
    I manually performed the steps to update the registry, though microsoft provides a "Fix It"; MicrosoftFixit50098.msi
    One other key element was to make sure to have kickstart-bytes="2048".

  • Max streaming connections per session error

    I have a flex application that uses messaging with a streaming AMF connection, falling back to polling. When the max number of streaming connections on the server is reached, it does fall back to polling (at least it prints the max-streaming-clients error but the client connects, so I assume it is falling back - how can I tell?). However, occasionally the streaming connection will not initialize and it does not fall back - no messages are received on the client. The following error is logged on the server:
    [EMST]09/25/2008 13:43:18.231 [ERROR] Endpoint with id 'my-streaming-amf' cannot grant streaming connection to FlexClient with id 'D5B8E3A1-1A1C-063E-84A6-6A743A1E4EE0' because max-streaming-connections-per-session limit of '1' has been reached.
    This would make sense if the issue was caused by trying to initialize the streaming connection in two tabs of a browser, but I am only trying to initialize in one tab. Closing the browser (and thus destroying the session) does not fix it. The only solution I've found is to reboot the client machine. This has happened in both FireFox 3.0.2 and IE 7.
    (1) What could cause the client to get in this state?
    (2) When it happens, why doesn't it fall back to polling? Is the fallback only for when the server max connections is reached? When the streaming connection doesn't initialize, no messages are received.
    (3) Is there a way to explicitly close the streaming connection on the client so we can fix this without rebooting?
    Thanks!

    Hi Mary. If you turn on Debug level logging on the client and the server you should be able to tell if you have fallen back to a polling channel after the attempt to connect over the streaming channel has been rejected. In the client log, you will see the flex application sending poll requests to the server at the polling interval configured in the channel and in the server log you should see that the server is receiving these requests.
    The behaviour you are seeing seems very strange to me. The reason we have the max-streaming-connections-per-session limit on the server is because most browsers limit the number of active connections that can be made to a server from a single session. In IE for example, this is 2. What happens in most cases when the browser's connection limit is reached is that new connections are put on hold until one of the existing connections closes. This would cause your flex application to hang with no errors being reported on the client or the server. This is why we need the max-streaming-connections-per-session setting on the server. This prevents more than one persistent connection from being made from the same session, so the browser should never reach it's max connections per server limit and lock up.
    It looks like you are somehow getting the browser to lock up even though the server is only limiting you to one streaming connection per session. It may be possible to do this if you reload the flex application in the browser (by doing a page refresh) in which case the browser could possibly briefly leave the streaming connection open in the background and when you tried to create a new streaming connection, the browser's connection limit to the server would have been reached and the application could hang. When the application hangs are you reloading the swf/page in the browser?
    I really don't know why closing the browser wouldn't fix the problem. You're right that closing the browser should end the session. If you launch a new browser and load the swf do you get the same "cannot grant streaming connection" error on the server or is the browser just locked up, ie. no error is received on the client and the server?
    You're not using a proxy server or anything like that are you that might be holding a connection open to the server?
    -Alex

  • Max-streaming-connections-per-session limit

    Hello,
    i'm trying BlazeDS with Air app.
    I set blazeDs on a Jboss Server with JMS adapter.
    I configure it with a streamingAMF channel.
    In user agent configuration i put msie, firefox value to 10 for the max-streaming-connections-per-session limit param.
    In Air client configuration i instantiate a producer and a consumer on the same streaming AMF channel.
    After the consumer.subscribe() i launch the producer.connect() on the server i get this error :
    14:25:20,015 INFO [STDOUT] [BlazeDS] Endpoint with id 'my-streaming-amf' cannot grant streaming connection to FlexClient with id '497031A2-7B0D-019A-0E1D-7622A-A631D28' because max-streaming-connections-per-session limit of '1' has been reached.
    Is it a limitation of use of blazeDs with Air app ?

    First, if you change the limit to 10, then it should be 10 and not 1. If you still see 1, then please log a bug.
    Second, you really want this limit to be 1 in IE and 4 in Firefox 2. But there's no reason to have more than 1 streaming connection from the server to the client unless you need to talk to two different endpoints.

  • Why does Photo Stream keeps switching itself off?

    Hello
    I use Photo Stream, but I sometimes wonder what the point is as I have found it to be extremely temperamental. Probably 90 per cent of the time I start up iPhoto, I find that Photo Stream has switched off on its own and of course I then have to spend a valuable minute or two switching it back on again. Sometimes new photos do not sync to Photo Stream as a result. This odd glitch has gotten increasingly irritating with time and I would love to fix it. Does anyone have any ideas? Thanks in anticipation!
    PS - I am using the latest version of iPhoto

    Do you have more than one library?  If you do each time you change libraries you will need to activate PhotoStream for that library as PhotoStream can only be activated on one library at a time.
    If you only have one library try the following:  make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    OT

  • Cdp neighbour shows the same switch as neighbour and the connected switch

    Hi
    I have a problem here , cdp neighbor  shows the same switch as the neighbor and the real connected switchh . I know it will show only the real connected switch if i shut and no sh . What i just want know is it a symptom for something else 
    Dist#sh cdp neighbors   Gig 10/10       
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                      D - Remote, C - CVTA, M - Two-port Mac Relay
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    Sw1
                     Gig 10/10        130              S I   WS-C3560- Gig 0/3
    Dist
                     Gig 10/10         156             R S I  WS-C6513    Gig 10/10
    Thank you

    HI,
    Did you did shut and no shut in the interface. ?
    Is it working fine.?
    is it fiber connected cable connected with these devices ?
    Regards,
    Gurudath K S

  • HT204053 Some reason my iCloud acct on my phone is set up to the 'me' account which I don't use, and my computer is set up to  icloud using my regular email. So, nothing is streaming & connecting. Can I delete the iCloud acct on my ph & re-sign in using o

    All of my apple items are registered to iCloud using one account. Then when I updated my phone to iOS 6, it automatically registered my phone to iCloud using my old mobile me email. So, my phone isn't streaming to computer, etc. Can I just delete the account on my phone and re-sign in using my other email to connect ALL my devices in iCloud without losing any information? Or how do I go about fixing this problem???? Thanks.

    If you want to change iCloud accounts and keep your data go to Settings>iCloud on your phone and turn all data you are syncing with iCloud (contacts, calendars, etc.) to Off.  When prompted choose to keep the data on your iPhone.  After everything is turned off, scroll to the bottom and tap Delete Account.  Next, set up a new iCloud account (or sign into your other existing iCloud account) using your other ID, then turn syncing for your data (contacts, etc.) back to On.  When prompted, choose Merge.  This will upload the data to your new account.

Maybe you are looking for

  • How do I Open Multiple Safari Windows on iPad 2?

    Prior to iOS 5, I was able to open multuple Safari windows.  Now it's one window with a handful of tabs. How do I open multiple windows?

  • What's New in Mail.app

    Hi, I am about to buy Snow leopard in a few days and I use mail.app extensively. Just wondering about the new features in mail.app. is it faster? any new features? I don't connect to exchange server

  • Exchange rate at GR

    I have maintained a exchange rate for GB vs USD I have created a Po for an Item with exchange rate maintained as floating. e.e I am not checking the fixed rate tab in PO header under Delivery tab. Now when I receive goods at later date,I want to have

  • How to determine the  Comp Cord / comp coordinator / Company Coordinator.

    Hi, In tcode pa30 i see there is Comp Cord field. so these are the HR persons right which use the three digits numbers. So my question is how to determine that the user/ pernr is comp cord? I want to create the fm and  pass user id as import and want

  • Horizontal scroll bar on text item

    Hi, I have a text item. I have enabled Vertical Scroll Bar. I need to enable Horizontal Scrolling as well on the text item. How is this possible? Thanks