I'm trying to develop an application using the new screen sharing classes and examples that are included in the last lccs sdk, but it seems that I run into some kind of local connection problem, so I have two questions.
1. I can't start 2 instances of applications that includes the mxml component collaboration:ScreenSharePublisher. why is that?
2. I start an application with the ScreenSharePublisher, then shut it down, and then start it again, I get an error:
ArgumentError: Error #2082: Connect failed because the object is already connected.
and the only thing i can do to fix it, is to restart my comp.
can you help?
I don't know about the specific errors on local connection server but I can say that screensharing only works connected to the real service.
Sent from my iPhone
The publisher communicates with the plugin via a LocalConnection. Because of this, you can't have more than one instance of it running on the machine at once. (LocalConnections are known to be somewhat flaky in general.)
In addition, the ScreenSharing doesn't work if the swf isn't served from a qualified domain. (It doesn't work if served from an ip address, as in, 127.0.0.1/foo.swf)
So, here's the takeaway:
1) Only start one publisher at a time. If you want to test it locally, do it with multiple browsers. (ie, firefox to publish, chrome to subscribe)
Our ScreenSharing uses LocalConnection and this is a famous issue with LocalConnection in playerZ( you can google it).
And you will get the problem, if your don't close your instance properly e.g. killing your browser that is sharing from the debugger.
So, to avoid such a problem , you can either use different browser instance as suggested by ablerman or you can close the stop the screen sharing always rather than killing the browser.
We are aware of the problem and are actively evaluating workarounds such as embedding the call in a try... catch function. You can also link to the source code and in ScreenSharePublisher.as , where it does localConnection.connect() , embed that in a try...catch block and see what happens.
Hope this helps
Actually, on the Run-Time-Exception front, we have a fix for this, which
should be in our patch release (coming very soon). In general, the way we've
been testing is one browser with the publisher, one browser with the
subscriber (and no publisher).
hope that helps,
I am giving a fix for your case. I am attaching ScreenSharePublisher.as file. This is a player 9, 10 and 10.1 file depending on which player swc you use.
You need to replace your respective ScreenSharePublisher.as with the one attached and link your app to the source sdk files.
As mentioned earlier, You will get this error if and only if, you are sharing your screen and you kill the publisher app either through debugger or task manager. To be safe, always do stop screen sharing and then close the browser to avoid the problem.
The way the entire fix works is this:
Let's say you have hit the problem already. Now, when you launch the app and do screen sharing with this fix, it may not do the sharing for you and instead give an error in debug logs regarding closing screen sharing properly. You need to then stop your sharing, close the browser and addin and relaunch your app again.
You willl then find everything working on relaunch.
We may not be able to put this fix in our patch release because we are too close to it and this affects only a miniscule portion of screen sharing developers. We will get this incorporated in next full release in coming months. Till then, linking to source files using the file attached should solve your problems.
Let us know if you face any issue.
Hope this helps
I am also getting into the same issue, I am able to publish the screen when I am using the localhost and not when I am using IP address or my computer name. Therefore I am not able to demo others to share their desktop with me, as publisher is not working using my IP address on other machines.
Just want to confirm,is there any solution available for the same. ?
Which SDK version you are using ? As far as I remember , this was fixed in 1.3.5 . Can you check your version in Release Notes going under payload/docs/ and if its less than 1.3.5 please upgrade your SDK.