rtmfp - NetConnection.Connect.Failed - can't get what's wrong (kaspersky settings) - actionscript

i'm developing an actionscript p2p application. everything worked fine until today.
this is my code:
private function initConnection():void{
nc = new NetConnection();
nc.maxPeerConnections = maxPC;
ExternalInterface.call("alert",maxPC);
nc.addEventListener(NetStatusEvent.NET_STATUS, ncStatus, false, 0, true);
nc.connect(SERVER_ADDRESS);
}
public function ncStatus(event:NetStatusEvent):void {
if (event.info.code == "NetConnection.Connect.Success") initSendStream();
else if (event.info.code == "NetStream.Connect.Closed") {
if (event.info.stream.farID) onPeerDisconnect(event.info.stream.farID);
}
else if (event.info.code == "NetConnection.Connect.Failed") ExternalInterface.call("p2pError", "conFailed")
else ExternalInterface.call("p2pError", "conFailedUnknown");
}
and i always got it worked. the key and rtmfp-server addres are right.
i can't understand why i allways has "NetConnection.Connect.Failed".
i search on the internet about this question. the possible sollution is to turn off firewall. but it allways turn off at my pc.
so i don't know what to do...
any suggestions?
any help appriciated!
Edit: well guys, i've just solved this problem. i got kaspersky with expired licence. so i turned it off but didn't delete. just turned off. few minutes ago i've deleted it and everything started working fine. but i'm still curious about what settings kaspersky could change. so question still open.

well, it seems coinsedence took place this time. kaspersky had nothing to deal with that. adobe cirrus server was down for few days.

Related

Sentry error - IndexSizeError: The index is not in the allowed range

I am getting this error from Sentry repetitively in ios - safari 14.0 in react project.
There is no code trace and no other information than this but it repeats in almost every URL.
I have already searched for the options everywhere. I have tried debugging but I can't replicate it, and so I can't resolve it.
Does anyone know what does this error means? Or how can I add debug information in Sentry?
I have been looking for the solution for a while and couldn't get it. I know it's a bit lack of information to provide but that's why I am asking this. if someone can tell me how to deal with sentry errors if you don't know why it is repeating so often, it will be really helpful.
A similar issue still exists.
Faced this in Safari when Draft.js is updating the editor state.
The error which I see: IndexSizeError: The index is not in the allowed range.
For me, playing around with Paragraph Directioncontext menus items after right-clicking on the Editor selection reproduced the error.
My Solution/hack:
Add it to any JS file executing before the Editor file.
const nativeSelectionExtend = Selection.prototype.extend;
Selection.prototype.extend = function (...args) {
try {
return nativeSelectionExtend.apply(this, args);
} catch (error) {
console.log('Selection error.', error);
}
};
It works properly for me. Maybe will be useful for somebody as well.
Thanks to https://github.com/shpakkdv

How can I persist Session data in a standalone web app after an external launch?

I have an MVC 5 mobile website that I am trying to make a standalone mobile web app running full screen on an iPhone. Everything works well until the app launches an external link that will, for example, launch in Safari. Upon returning to the web app the Session data seems to disappear and a new Session Id is assigned, wiping out any existing trace of previous user progress prior to the external launch. The User Name, however, remains intact and “logged in”. What do I need to do to persist the Session data?
I’ve been at this for hours now, googling and trying different approaches, but to no avail and my head is spinning. A similar post is HERE but my problem is the Session data.
Any help/direction would be greatly appreciated.
UPDATE 1
It seems that this behavior is limited to iOS -- currently testing on 9.3.3. Same behavior whether the "Back to [App] upper left link in the status bar is used or double-tap on the home button to return to WebApp. Android OSs seem to work just fine. Go figure. We are using cookies.
So it was a "Hail-Mary pass" but it worked... just persist the ASP.NET_SessionId cookie in javascript. It may have worked elsewhere but here's what I did:
In _Layout.vbhtml I added this to $(document).ready:
if (window.navigator.standalone || window.matchMedia('(display-mode: standalone)').matches) {
document.cookie = "ASP.NET_SessionId=#(Session.SessionID); " + extendTimeStr(5);
}
along with the function:
function extendTimeStr(extMins) {
var d = new Date();
d.setTime(d.getTime() + (extMins*60*1000));
return "expires="+ d.toUTCString();
}
Magically, it worked! Hope it helps someone.
Update for AspNetCore 2.0:
$(document).ready(function () {
if (('standalone' in window.navigator) && window.navigator['standalone']) {
var cookie = '#(Context.Request.Cookies[".AspNetCore.Identity.Application"])';
document.cookie = ".AspNetCore.Identity.Application=" + cookie + "; " + extendTimeStr(5);
}
})
Thank you #HumbleBeginnings for your excellent and simple solution to a problem I can't find answers to elsewhere!

Submission to Apple for app doesn't run the same locally vs at Apple with Parse.com backend

I'm hoping another developer has come across this somewhere. I have an app I have been trying to get approved by Apple. The interesting thing is the app behaves differently while running locally on my iPhone and in the iOS Simulator. Specifically when a new user signs up I am checking a flag as to if the Users have agreed to the apps Terms and Conditions. In Parse the column is set to undefined until they agree then it goes to true. This works fine in all my testing. But at Apple it is not and is not triggering the Agree to Terms condition. Here is the code for that check:
if((PFUser.currentUser()!["termsAgreed"]) != nil) {
termsAgreed = PFUser.currentUser()!["termsAgreed"] as! Bool
if !termsAgreed {
self.performSegueWithIdentifier("agreeTerms", sender: nil)
}
}
else {
self.performSegueWithIdentifier("agreeTerms", sender: nil)
I made a new change to see if it helps, in that when a user signs up I set PFUser.currentUser()!["termsAgreed"] to false before this check
I'm hoping that enforces the terms agreement condition to fail on Apples end but would like some feedback from anyone experiencing something like this.
Depending on what your actual question might be, using force unwrapping is not considered quite safe. Your code would be much more stable like this:
if let termsAgreed = PFUser.currentUser()?["termsAgreed"] as? Bool where
!termsAgreed {
self.performSegueWithIdentifier("agreeTerms", sender: nil)
}
else {
// proceed
}
PS: I hope that is syntactically correct - I have no IDE at hand atm.

Video is not playing repeating iOS. Show this log

When I load the Video url in MPMovieplayercontroller in Similator
the log is printing like this what can I do now.
_itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}
So, that the Video is not Viewing in my player
help me..
There could be some problems with your url...
Your url could have spaces. Fill the spaces - stringByAddingPercentEscapesUsingEncoding.
Try changing the source type of the player this might help.
movieplayer. movieSourceType = // source type.
Try running app on a device also sometimes might be the problem due to simulator.
First try on real device if it doesnot work try the above 2 suggestions.
Just a word of warning since I battled this problem for 2 hours and it turned out to be something really simple and quite surprising.
MPMoviePlayerViewController in iOS7 cannot play mov files. In iOS8, however, it works fine.

Backbone on BlackBerry OS5 - is it possible?

I'm developing a mobile application using Backbone, jQueryMobile and Phonegap. The app works great on Android, iOS and BB >= 6, but on BB5 as expected there are countless issues coming up.
I'm now facing problems with Backbone itself. I'm debugging it and looks like the problem is in the routes definition. The application crashes on start time due to something related to it (still investigating, but debugging is painful for BB5...).
Also, I read that BB5 won't play nice with hash listening, which Backbone relies on to do the navigation, so I am wondering if somebody has been able to create a backbone app on OS5, or is it simply not possible?
I'm updating this question just in case someone faces the same issue:
Short story: it's not possible to run Backbone on OS5. I debugged into backbone and some instructions with regular expressions were causing a crash. Even if these are fixed in the future, we determined that the js support was simply not good enough and finally discarded the OS5 version.
It is probably not worth it in most cases but this is doable.
I managed to get an app running after quite a bit of work - the javascript support is really not great in OS 5.0 and debugging is very very slow as suggested in bfcapell's answer.
To get backbone to work you need to comment out the code that uses the hashchange event to handle url changes (this is assuming that the router is being used). THere is a fallback in backbone which uses setinterval to poll for changes.
// Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state.
/*if (this._hasPushState)
{
alert('pushstate');
$(window).bind('popstate', this.checkUrl);
} else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE)
{
alert('hashchange');
$(window).bind('hashchange', this.checkUrl);
} else if (this._wantsHashChange)
{*/
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
//}
The foreach method in underscore also needs to be modified to not use the native foreach method. This is needed for collections to be rendered correctly.
var each = _.each = _.forEach = function (obj, iterator, context)
{
if (obj == null) return;
/*if (nativeForEach && obj.forEach === nativeForEach)
{
obj.forEach(iterator, context);
}
else*/
if (obj.length === +obj.length)
The above should get at least backbone mostly working. (I say mostly because I have a completely working app but I suspect to find a couple more OS5 specific issues in time).

Resources